Example usage for com.vaadin.server FontAwesome EXTERNAL_LINK

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

Introduction

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

Prototype

FontAwesome EXTERNAL_LINK

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

Click Source Link

Usage

From source file:annis.gui.querybuilder.NodeWindow.java

License:Apache License

public NodeWindow(int id, TigerQueryBuilderCanvas parent) {
    this.parent = parent;
    this.id = id;
    this.annoNames = new TreeSet<>();

    for (String a : parent.getAvailableAnnotationNames()) {
        annoNames.add(a.replaceFirst("^[^:]*:", ""));
    }//ww w .  j ava2s  .c o m
    constraints = new ArrayList<>();

    setSizeFull();

    // HACK: use our own border since the one from chameleon does not really work
    addStyleName(ValoTheme.PANEL_WELL);
    //addStyleName("border-layout");

    prepareEdgeDock = false;

    vLayout = new VerticalLayout();
    setContent(vLayout);
    vLayout.setWidth("100%");
    vLayout.setHeight("-1px");
    vLayout.setMargin(false);
    vLayout.setSpacing(true);

    toolbar = new HorizontalLayout();
    toolbar.addStyleName("toolbar");
    toolbar.setWidth("100%");
    toolbar.setHeight("-1px");
    toolbar.setMargin(false);
    toolbar.setSpacing(false);
    vLayout.addComponent(toolbar);

    btMove = new Button();
    btMove.setWidth("100%");
    btMove.setIcon(FontAwesome.ARROWS);
    btMove.setDescription("<strong>Move node</strong><br />Click, hold and move mouse to move the node.");
    btMove.addStyleName(ValoTheme.BUTTON_SMALL);
    btMove.addStyleName("drag-source-enabled");
    toolbar.addComponent(btMove);

    btEdge = new Button("Edge");
    btEdge.setIcon(FontAwesome.EXTERNAL_LINK);
    btEdge.addClickListener((Button.ClickListener) this);
    btEdge.addStyleName(ValoTheme.BUTTON_SMALL);
    //btEdge.addStyleName(ChameleonTheme.BUTTON_LINK);
    btEdge.setDescription("<strong>Add Edge</strong><br />" + "To create a new edge between "
            + "two nodes click this button first. " + "Then define a destination node by clicking its \"Dock\" "
            + "button.<br>You can cancel the action by clicking this button " + "(\"Cancel\") again.");
    btEdge.setImmediate(true);
    toolbar.addComponent(btEdge);

    btAdd = new Button("Add");
    btAdd.setIcon(FontAwesome.PLUS);
    btAdd.addStyleName(ValoTheme.BUTTON_SMALL);
    //btAdd.addStyleName(ChameleonTheme.BUTTON_LINK);
    btAdd.addClickListener((Button.ClickListener) this);
    btAdd.setDescription("<strong>Add Node Condition</strong><br />"
            + "Every condition will constraint the node described by this window. "
            + "Most conditions limit the node by defining which annotations and which "
            + "values of the annotation a node needs to have.");
    toolbar.addComponent(btAdd);

    btClear = new Button("Clear");
    btClear.setIcon(FontAwesome.TRASH_O);
    btClear.addStyleName(ValoTheme.BUTTON_SMALL);
    //btClear.addStyleName(ChameleonTheme.BUTTON_LINK);
    btClear.addClickListener((Button.ClickListener) this);
    btClear.setDescription("<strong>Clear All Node Conditions</strong>");
    toolbar.addComponent(btClear);

    btClose = new Button();
    btClose.setIcon(FontAwesome.TIMES_CIRCLE);
    btClose.setDescription("<strong>Close</strong><br />Close this node description window");
    btClose.addStyleName(ValoTheme.BUTTON_SMALL);
    btClose.addClickListener((Button.ClickListener) this);
    toolbar.addComponent(btClose);

    toolbar.setComponentAlignment(btMove, Alignment.TOP_LEFT);
    toolbar.setExpandRatio(btMove, 1.0f);

    toolbar.setComponentAlignment(btEdge, Alignment.TOP_CENTER);
    toolbar.setComponentAlignment(btAdd, Alignment.TOP_CENTER);
    toolbar.setComponentAlignment(btClear, Alignment.TOP_CENTER);
    toolbar.setComponentAlignment(btClose, Alignment.TOP_RIGHT);

}

From source file:annis.gui.querybuilder.NodeWindow.java

License:Apache License

public void setPrepareEdgeDock(boolean prepare) {
    this.prepareEdgeDock = prepare;

    btClear.setVisible(!prepare);/*from  w w w . j a  v a2 s . co  m*/
    btClose.setVisible(!prepare);
    btAdd.setVisible(!prepare);
    btMove.setVisible(!prepare);

    if (prepare) {
        btEdge.setCaption("Dock");
        btEdge.setIcon(new ThemeResource("images/pixel.png"));
    } else {
        btEdge.setIcon(FontAwesome.EXTERNAL_LINK);
        btEdge.setCaption("Edge");
    }
}

From source file:com.esofthead.mycollab.module.project.view.bug.BugListViewImpl.java

License:Open Source License

private ComponentContainer constructTableActionControls() {
    final MHorizontalLayout layout = new MHorizontalLayout().withWidth("100%");

    final Label lbEmpty = new Label("");
    layout.with(lbEmpty).expand(lbEmpty);

    MHorizontalLayout buttonControls = new MHorizontalLayout();
    layout.addComponent(buttonControls);

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

        @Override//from ww w  .  jav a  2 s  .  co m
        public void buttonClick(ClickEvent event) {
            UI.getCurrent().addWindow(new BugListCustomizeWindow(BugListView.VIEW_DEF_ID, tableItem));

        }
    });
    customizeViewBtn.setIcon(FontAwesome.COG);
    customizeViewBtn.setDescription("Layout Options");
    customizeViewBtn.setStyleName(UIConstants.THEME_GRAY_LINK);
    buttonControls.addComponent(customizeViewBtn);

    PopupButton exportButtonControl = new PopupButton();
    exportButtonControl.addStyleName(UIConstants.THEME_GRAY_LINK);
    exportButtonControl.setIcon(FontAwesome.EXTERNAL_LINK);
    exportButtonControl.setDescription(AppContext.getMessage(FileI18nEnum.EXPORT_FILE));

    VerticalLayout popupButtonsControl = new VerticalLayout();
    exportButtonControl.setContent(popupButtonsControl);

    Button exportPdfBtn = new Button(AppContext.getMessage(FileI18nEnum.PDF));

    StreamWrapperFileDownloader fileDownloader = new StreamWrapperFileDownloader(new StreamResourceFactory() {

        @Override
        public StreamResource getStreamResource() {
            String title = "Bugs of Project " + ((CurrentProjectVariables.getProject() != null
                    && CurrentProjectVariables.getProject().getName() != null)
                            ? CurrentProjectVariables.getProject().getName()
                            : "");
            BugSearchCriteria searchCriteria = new BugSearchCriteria();
            searchCriteria.setProjectId(
                    new NumberSearchField(SearchField.AND, CurrentProjectVariables.getProject().getId()));

            return new StreamResource(new SimpleGridExportItemsStreamResource.AllItems<>(title,
                    new RpParameterBuilder(tableItem.getDisplayColumns()), ReportExportType.PDF,
                    ApplicationContextUtil.getSpringBean(BugService.class), searchCriteria, SimpleBug.class),
                    "export.pdf");
        }

    });
    fileDownloader.extend(exportPdfBtn);
    exportPdfBtn.setIcon(FontAwesome.FILE_PDF_O);
    exportPdfBtn.setStyleName("link");
    popupButtonsControl.addComponent(exportPdfBtn);

    Button exportExcelBtn = new Button(AppContext.getMessage(FileI18nEnum.EXCEL));
    StreamWrapperFileDownloader excelDownloader = new StreamWrapperFileDownloader(new StreamResourceFactory() {

        @Override
        public StreamResource getStreamResource() {
            String title = "Bugs of Project " + ((CurrentProjectVariables.getProject() != null
                    && CurrentProjectVariables.getProject().getName() != null)
                            ? CurrentProjectVariables.getProject().getName()
                            : "");
            BugSearchCriteria searchCriteria = new BugSearchCriteria();
            searchCriteria.setProjectId(
                    new NumberSearchField(SearchField.AND, CurrentProjectVariables.getProject().getId()));

            return new StreamResource(new SimpleGridExportItemsStreamResource.AllItems<>(title,
                    new RpParameterBuilder(tableItem.getDisplayColumns()), ReportExportType.EXCEL,
                    ApplicationContextUtil.getSpringBean(BugService.class), searchCriteria, SimpleBug.class),
                    "export.xlsx");
        }
    });
    excelDownloader.extend(exportExcelBtn);
    exportExcelBtn.setIcon(FontAwesome.FILE_EXCEL_O);
    exportExcelBtn.setStyleName("link");
    popupButtonsControl.addComponent(exportExcelBtn);

    Button exportCsvBtn = new Button(AppContext.getMessage(FileI18nEnum.CSV));

    StreamWrapperFileDownloader csvFileDownloader = new StreamWrapperFileDownloader(
            new StreamResourceFactory() {

                @Override
                public StreamResource getStreamResource() {
                    String title = "Bugs of Project " + ((CurrentProjectVariables.getProject() != null
                            && CurrentProjectVariables.getProject().getName() != null)
                                    ? CurrentProjectVariables.getProject().getName()
                                    : "");
                    BugSearchCriteria searchCriteria = new BugSearchCriteria();
                    searchCriteria.setProjectId(new NumberSearchField(SearchField.AND,
                            CurrentProjectVariables.getProject().getId()));

                    return new StreamResource(new SimpleGridExportItemsStreamResource.AllItems<>(title,
                            new RpParameterBuilder(tableItem.getDisplayColumns()), ReportExportType.CSV,
                            ApplicationContextUtil.getSpringBean(BugService.class), searchCriteria,
                            SimpleBug.class), "export.csv");
                }
            });
    csvFileDownloader.extend(exportCsvBtn);

    exportCsvBtn.setIcon(FontAwesome.FILE_TEXT_O);
    exportCsvBtn.setStyleName("link");
    popupButtonsControl.addComponent(exportCsvBtn);

    buttonControls.addComponent(exportButtonControl);
    return layout;
}

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

License:Open Source License

public FollowingTicketViewImpl() {
    this.setWidth("100%");

    final MVerticalLayout headerWrapper = new MVerticalLayout().withSpacing(false).withMargin(false)
            .withWidth("100%").withStyleName("projectfeed-hdr-wrapper");

    final MHorizontalLayout header = new MHorizontalLayout().withMargin(false).withWidth("100%");

    final Label layoutHeader = new Label(FontAwesome.EYE.getHtml() + " My Following Tickets", ContentMode.HTML);
    layoutHeader.addStyleName("h2");
    header.with(layoutHeader).withAlign(layoutHeader, Alignment.MIDDLE_LEFT).expand(layoutHeader);

    headerWrapper.addComponent(header);//from   ww w .  ja  v a  2  s  .co m
    this.addComponent(headerWrapper);

    MHorizontalLayout controlBtns = new MHorizontalLayout().withSpacing(false)
            .withMargin(new MarginInfo(true, false, true, false)).withWidth("100%");

    final MVerticalLayout contentWrapper = new MVerticalLayout().withSpacing(false).withMargin(false)
            .withWidth("100%");
    contentWrapper.addStyleName("content-wrapper");

    contentWrapper.addComponent(controlBtns);
    this.addComponent(contentWrapper);

    final Button backBtn = new Button(AppContext.getMessage(FollowerI18nEnum.BUTTON_BACK_TO_WORKBOARD));
    backBtn.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final ClickEvent event) {
            EventBusFactory.getInstance()
                    .post(new ShellEvent.GotoProjectModule(FollowingTicketViewImpl.this, null));
        }
    });

    backBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
    backBtn.setIcon(FontAwesome.ARROW_LEFT);

    controlBtns.addComponent(backBtn);
    controlBtns.setExpandRatio(backBtn, 1.0f);

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

        @Override
        public void buttonClick(ClickEvent event) {
            exportButtonControl.setPopupVisible(true);
        }
    });
    exportButtonControl = new SplitButton(exportBtn);
    exportButtonControl.setWidthUndefined();
    exportButtonControl.addStyleName(UIConstants.THEME_GRAY_LINK);
    exportButtonControl.setIcon(FontAwesome.EXTERNAL_LINK);

    VerticalLayout popupButtonsControl = new VerticalLayout();
    exportButtonControl.setContent(popupButtonsControl);

    Button exportPdfBtn = new Button("Pdf");
    FileDownloader pdfDownloader = new FileDownloader(constructStreamResource(ReportExportType.PDF));
    pdfDownloader.extend(exportPdfBtn);
    exportPdfBtn.setIcon(FontAwesome.FILE_PDF_O);
    exportPdfBtn.setStyleName("link");
    popupButtonsControl.addComponent(exportPdfBtn);

    Button exportExcelBtn = new Button("Excel");
    FileDownloader excelDownloader = new FileDownloader(constructStreamResource(ReportExportType.EXCEL));
    excelDownloader.extend(exportExcelBtn);
    exportExcelBtn.setIcon(FontAwesome.FILE_EXCEL_O);
    exportExcelBtn.setStyleName("link");
    popupButtonsControl.addComponent(exportExcelBtn);

    controlBtns.addComponent(exportButtonControl);

    searchPanel = new FollowingTicketSearchPanel();
    contentWrapper.addComponent(searchPanel);

    this.ticketTable = new FollowingTicketTableDisplay();
    this.ticketTable.addStyleName("full-border-table");
    this.ticketTable.setMargin(new MarginInfo(true, false, false, false));
    contentWrapper.addComponent(this.ticketTable);
}

From source file:com.esofthead.mycollab.module.project.view.page.PageReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createButtonControls() {
    ProjectPreviewFormControlsGenerator<Page> pagesPreviewForm = new ProjectPreviewFormControlsGenerator<>(
            previewForm);//from  w  w w  . j  a  v a2  s. c  om
    final HorizontalLayout topPanel = pagesPreviewForm.createButtonControls(
            ProjectPreviewFormControlsGenerator.ADD_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.EDIT_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.DELETE_BTN_PRESENTED,
            ProjectRolePermissionCollections.PAGES);

    exportPdfBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF),
            FontAwesome.EXTERNAL_LINK);
    exportPdfBtn.setStyleName(UIConstants.THEME_GREEN_LINK);

    FileDownloader fileDownloader = new FileDownloader(getPDFStream());
    fileDownloader.extend(exportPdfBtn);

    pagesPreviewForm.insertToControlBlock(exportPdfBtn);

    return topPanel;
}

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

License:Open Source License

private void constructUI() {
    this.removeAllComponents();
    this.withMargin(new MarginInfo(false, true, true, true));

    header = new MHorizontalLayout().withMargin(new MarginInfo(true, false, true, false))
            .withStyleName("hdr-view").withWidth("100%");
    header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

    this.taskGroupSelection = new PopupButton(
            AppContext.getMessage(TaskGroupI18nEnum.FILTER_ACTIVE_TASK_GROUPS_TITLE));
    this.taskGroupSelection.setEnabled(CurrentProjectVariables.canRead(ProjectRolePermissionCollections.TASKS));
    this.taskGroupSelection.addStyleName("link");
    this.taskGroupSelection.addStyleName("hdr-text");
    taskGroupSelection.setIcon(ProjectAssetsManager.getAsset(ProjectTypeConstants.TASK_LIST));
    header.with(taskGroupSelection).withAlign(taskGroupSelection, Alignment.MIDDLE_LEFT)
            .expand(taskGroupSelection);

    final MVerticalLayout filterBtnLayout = new MVerticalLayout().withMargin(true).withSpacing(true)
            .withWidth("200px");

    final Button allTasksFilterBtn = new Button(
            AppContext.getMessage(TaskGroupI18nEnum.FILTER_ALL_TASK_GROUPS_TITLE), new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override/*from w  w  w  .j ava 2 s.co m*/
                public void buttonClick(final ClickEvent event) {
                    TaskGroupDisplayViewImpl.this.taskGroupSelection.setPopupVisible(false);
                    TaskGroupDisplayViewImpl.this.taskGroupSelection
                            .setCaption(AppContext.getMessage(TaskGroupI18nEnum.FILTER_ALL_TASK_GROUPS_TITLE));
                    TaskGroupDisplayViewImpl.this.displayAllTaskGroups();
                }
            });
    allTasksFilterBtn.setStyleName("link");
    filterBtnLayout.addComponent(allTasksFilterBtn);

    final Button activeTasksFilterBtn = new Button(
            AppContext.getMessage(TaskGroupI18nEnum.FILTER_ACTIVE_TASK_GROUPS_TITLE),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(final ClickEvent event) {
                    TaskGroupDisplayViewImpl.this.taskGroupSelection.setPopupVisible(false);
                    TaskGroupDisplayViewImpl.this.taskGroupSelection.setCaption(
                            AppContext.getMessage(TaskGroupI18nEnum.FILTER_ACTIVE_TASK_GROUPS_TITLE));
                    TaskGroupDisplayViewImpl.this.displayActiveTaskGroups();
                }
            });
    activeTasksFilterBtn.setStyleName("link");
    filterBtnLayout.addComponent(activeTasksFilterBtn);

    final Button archivedTasksFilterBtn = new Button(
            AppContext.getMessage(TaskGroupI18nEnum.FILTER_ARCHIEVED_TASK_GROUPS_TITLE),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(final ClickEvent event) {
                    TaskGroupDisplayViewImpl.this.taskGroupSelection.setCaption(
                            AppContext.getMessage(TaskGroupI18nEnum.FILTER_ARCHIEVED_TASK_GROUPS_TITLE));
                    TaskGroupDisplayViewImpl.this.taskGroupSelection.setPopupVisible(false);
                    TaskGroupDisplayViewImpl.this.displayInActiveTaskGroups();
                }
            });
    archivedTasksFilterBtn.setStyleName("link");
    filterBtnLayout.addComponent(archivedTasksFilterBtn);

    this.taskGroupSelection.setContent(filterBtnLayout);

    final Button newTaskListBtn = new Button(AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASKGROUP),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(final ClickEvent event) {
                    final TaskGroupAddWindow taskListWindow = new TaskGroupAddWindow(
                            TaskGroupDisplayViewImpl.this);
                    UI.getCurrent().addWindow(taskListWindow);
                }
            });
    newTaskListBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS));
    newTaskListBtn.setIcon(FontAwesome.PLUS);
    newTaskListBtn.setDescription(AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASKGROUP));
    newTaskListBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
    header.addComponent(newTaskListBtn);
    header.setComponentAlignment(newTaskListBtn, Alignment.MIDDLE_RIGHT);

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

        @Override
        public void buttonClick(final ClickEvent event) {
            EventBusFactory.getInstance().post(new TaskListEvent.ReoderTaskList(this, null));
        }
    });
    reOrderBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS));
    reOrderBtn.setIcon(FontAwesome.SORT);
    reOrderBtn.setStyleName(UIConstants.THEME_BLUE_LINK);
    reOrderBtn.setDescription(AppContext.getMessage(TaskI18nEnum.BUTTON_REODER_TASKGROUP));
    header.addComponent(reOrderBtn);
    header.setComponentAlignment(reOrderBtn, Alignment.MIDDLE_RIGHT);

    PopupButton exportButtonControl = new PopupButton();
    exportButtonControl.addStyleName(UIConstants.THEME_BLUE_LINK);
    exportButtonControl.setIcon(FontAwesome.EXTERNAL_LINK);
    exportButtonControl.setDescription("Export to file");

    VerticalLayout popupButtonsControl = new VerticalLayout();
    exportButtonControl.setContent(popupButtonsControl);
    exportButtonControl.setWidthUndefined();

    Button exportPdfBtn = new Button(AppContext.getMessage(FileI18nEnum.PDF));
    FileDownloader pdfDownloader = new FileDownloader(constructStreamResource(ReportExportType.PDF));
    pdfDownloader.extend(exportPdfBtn);
    exportPdfBtn.setIcon(FontAwesome.FILE_PDF_O);
    exportPdfBtn.setStyleName("link");
    popupButtonsControl.addComponent(exportPdfBtn);

    Button exportExcelBtn = new Button(AppContext.getMessage(FileI18nEnum.EXCEL));
    FileDownloader excelDownloader = new FileDownloader(constructStreamResource(ReportExportType.EXCEL));
    excelDownloader.extend(exportExcelBtn);
    exportExcelBtn.setIcon(FontAwesome.FILE_EXCEL_O);
    exportExcelBtn.setStyleName("link");
    popupButtonsControl.addComponent(exportExcelBtn);

    header.with(exportButtonControl).withAlign(exportButtonControl, Alignment.MIDDLE_LEFT);

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

        @Override
        public void buttonClick(ClickEvent event) {
            displayAdvancedView();
        }
    });
    advanceDisplayBtn.setIcon(FontAwesome.SITEMAP);
    advanceDisplayBtn.setDescription(AppContext.getMessage(TaskGroupI18nEnum.ADVANCED_VIEW_TOOLTIP));

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

        @Override
        public void buttonClick(ClickEvent event) {
            TaskSearchCriteria searchCriteria = new TaskSearchCriteria();
            searchCriteria.setProjectid(new NumberSearchField(CurrentProjectVariables.getProjectId()));
            searchCriteria.setStatuses(new SetSearchField<>(new String[] { StatusI18nEnum.Open.name() }));
            TaskFilterParameter taskFilter = new TaskFilterParameter(searchCriteria, "Task Search");
            taskFilter.setAdvanceSearch(true);
            moveToTaskSearch(taskFilter);
        }
    });
    simpleDisplayBtn.setIcon(FontAwesome.LIST_UL);
    simpleDisplayBtn.setDescription(AppContext.getMessage(TaskGroupI18nEnum.LIST_VIEW_TOOLTIP));

    Button chartDisplayBtn = new Button(null, new Button.ClickListener() {
        private static final long serialVersionUID = -5707546605789537298L;

        @Override
        public void buttonClick(ClickEvent event) {
            displayGanttChartView();
        }
    });
    chartDisplayBtn.setIcon(FontAwesome.BAR_CHART_O);

    viewButtons = new ToggleButtonGroup();
    viewButtons.addButton(simpleDisplayBtn);
    viewButtons.addButton(advanceDisplayBtn);
    viewButtons.addButton(chartDisplayBtn);
    viewButtons.setDefaultButton(advanceDisplayBtn);

    mainLayout = new MHorizontalLayout().withFullHeight().withFullWidth().withSpacing(true);
    this.taskListsWidget = new TaskGroupDisplayWidget();

    MVerticalLayout leftColumn = new MVerticalLayout().withMargin(new MarginInfo(false, true, false, false))
            .with(taskListsWidget);

    this.rightColumn = new MVerticalLayout().withWidth("300px")
            .withMargin(new MarginInfo(true, false, false, false));

    mainLayout.with(leftColumn, rightColumn).expand(leftColumn);

    FloatingComponent floatSidebar = FloatingComponent.floatThis(this.rightColumn);
    floatSidebar.setContainerId("main-body");

    implementTaskFilterButton();
    basicSearchView = new TaskSearchViewImpl();
    basicSearchView.getSearchHandlers().addSearchHandler(new SearchHandler<TaskSearchCriteria>() {
        @Override
        public void onSearch(TaskSearchCriteria criteria) {
            doSearch(criteria);
        }
    });
    basicSearchView.removeComponent(basicSearchView.getComponent(0));

    displayAdvancedView();
}

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

License:Open Source License

@Override
public void display() {
    projects = ApplicationContextUtil.getSpringBean(ProjectService.class)
            .getProjectsUserInvolved(AppContext.getUsername(), AppContext.getAccountId());
    if (CollectionUtils.isNotEmpty(projects)) {
        itemTimeLoggingService = ApplicationContextUtil.getSpringBean(ItemTimeLoggingService.class);

        final CssLayout headerWrapper = new CssLayout();
        headerWrapper.setWidth("100%");
        headerWrapper.setStyleName("projectfeed-hdr-wrapper");

        HorizontalLayout loggingPanel = new HorizontalLayout();

        HorizontalLayout controlBtns = new HorizontalLayout();
        controlBtns.setMargin(new MarginInfo(true, false, true, false));

        final Label layoutHeader = new Label(
                ProjectAssetsManager.getAsset(ProjectTypeConstants.TIME).getHtml() + " Time Tracking",
                ContentMode.HTML);
        layoutHeader.addStyleName("h2");

        final MHorizontalLayout header = new MHorizontalLayout().withWidth("100%");
        header.with(layoutHeader).withAlign(layoutHeader, Alignment.MIDDLE_LEFT).expand(layoutHeader);

        final CssLayout contentWrapper = new CssLayout();
        contentWrapper.setWidth("100%");
        contentWrapper.addStyleName(UIConstants.CONTENT_WRAPPER);

        headerWrapper.addComponent(header);
        this.addComponent(headerWrapper);
        contentWrapper.addComponent(controlBtns);

        MHorizontalLayout controlsPanel = new MHorizontalLayout().withWidth("100%");

        contentWrapper.addComponent(controlsPanel);
        contentWrapper.addComponent(loggingPanel);
        this.addComponent(contentWrapper);

        final Button backBtn = new Button("Back to Workboard");
        backBtn.addClickListener(new Button.ClickListener() {
            private static final long serialVersionUID = 1L;

            @Override//from www.  j av  a  2s.c  o m
            public void buttonClick(final ClickEvent event) {
                EventBusFactory.getInstance()
                        .post(new ShellEvent.GotoProjectModule(TimeTrackingSummaryViewImpl.this, null));

            }
        });

        backBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
        backBtn.setIcon(FontAwesome.ARROW_LEFT);

        controlBtns.addComponent(backBtn);

        VerticalLayout selectionLayoutWrapper = new VerticalLayout();
        selectionLayoutWrapper.setWidth("100%");
        selectionLayoutWrapper.addStyleName("time-tracking-summary-search-panel");
        controlsPanel.addComponent(selectionLayoutWrapper);

        final GridLayout selectionLayout = new GridLayout(9, 2);
        selectionLayout.setSpacing(true);
        selectionLayout.setDefaultComponentAlignment(Alignment.TOP_RIGHT);
        selectionLayout.setMargin(true);
        selectionLayoutWrapper.addComponent(selectionLayout);

        Label fromLb = new Label("From:");
        fromLb.setWidthUndefined();
        selectionLayout.addComponent(fromLb, 0, 0);

        this.fromDateField = new PopupDateFieldExt();
        this.fromDateField.setResolution(Resolution.DAY);
        this.fromDateField.setDateFormat(AppContext.getUserDateFormat());
        this.fromDateField.setWidth("100px");
        selectionLayout.addComponent(this.fromDateField, 1, 0);

        Label toLb = new Label("To:");
        toLb.setWidthUndefined();
        selectionLayout.addComponent(toLb, 2, 0);

        this.toDateField = new PopupDateFieldExt();
        this.toDateField.setResolution(Resolution.DAY);
        this.toDateField.setDateFormat(AppContext.getUserDateFormat());
        this.toDateField.setWidth("100px");
        selectionLayout.addComponent(this.toDateField, 3, 0);

        Label groupLb = new Label("Group:");
        groupLb.setWidthUndefined();
        selectionLayout.addComponent(groupLb, 0, 1);

        this.groupField = new ValueComboBox(false, GROUPBY_PROJECT, GROUPBY_DATE, GROUPBY_USER);
        this.groupField.setWidth("100px");
        selectionLayout.addComponent(this.groupField, 1, 1);

        Label sortLb = new Label("Sort:");
        sortLb.setWidthUndefined();
        selectionLayout.addComponent(sortLb, 2, 1);

        this.orderField = new ItemOrderComboBox();
        this.orderField.setWidth("100px");
        selectionLayout.addComponent(this.orderField, 3, 1);

        Label projectLb = new Label("Project:");
        projectLb.setWidthUndefined();
        selectionLayout.addComponent(projectLb, 4, 0);

        this.projectField = new UserInvolvedProjectsListSelect();
        initListSelectStyle(this.projectField);
        selectionLayout.addComponent(this.projectField, 5, 0, 5, 1);

        Label userLb = new Label("User:");
        userLb.setWidthUndefined();
        selectionLayout.addComponent(userLb, 6, 0);

        this.userField = new UserInvolvedProjectsMemberListSelect(getProjectIds());
        initListSelectStyle(this.userField);
        selectionLayout.addComponent(this.userField, 7, 0, 7, 1);

        final Button queryBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SUBMIT),
                new Button.ClickListener() {
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void buttonClick(final ClickEvent event) {
                        fromDate = fromDateField.getValue();
                        toDate = toDateField.getValue();
                        searchCriteria.setRangeDate(new RangeDateSearchField(fromDate, toDate));
                        searchTimeReporting();
                    }
                });
        queryBtn.setStyleName(UIConstants.THEME_GREEN_LINK);

        selectionLayout.addComponent(queryBtn, 8, 0);

        loggingPanel.setWidth("100%");
        loggingPanel.setHeight("80px");
        loggingPanel.setSpacing(true);

        totalHoursLoggingLabel = new Label("Total Hours Logging: 0 Hrs", ContentMode.HTML);
        totalHoursLoggingLabel.addStyleName(UIConstants.LAYOUT_LOG);
        totalHoursLoggingLabel.addStyleName(UIConstants.TEXT_LOG_DATE_FULL);
        loggingPanel.addComponent(totalHoursLoggingLabel);
        loggingPanel.setExpandRatio(totalHoursLoggingLabel, 1.0f);
        loggingPanel.setComponentAlignment(totalHoursLoggingLabel, Alignment.MIDDLE_LEFT);

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

            @Override
            public void buttonClick(ClickEvent event) {
                exportButtonControl.setPopupVisible(true);

            }
        });
        exportButtonControl = new SplitButton(exportBtn);
        exportButtonControl.setWidthUndefined();
        exportButtonControl.addStyleName(UIConstants.THEME_GRAY_LINK);
        exportButtonControl.setIcon(FontAwesome.EXTERNAL_LINK);

        VerticalLayout popupButtonsControl = new VerticalLayout();
        exportButtonControl.setContent(popupButtonsControl);

        Button exportPdfBtn = new Button("Pdf");
        FileDownloader pdfDownloader = new FileDownloader(constructStreamResource(ReportExportType.PDF));
        pdfDownloader.extend(exportPdfBtn);
        exportPdfBtn.setIcon(FontAwesome.FILE_PDF_O);
        exportPdfBtn.setStyleName("link");
        popupButtonsControl.addComponent(exportPdfBtn);

        Button exportExcelBtn = new Button("Excel");
        FileDownloader excelDownloader = new FileDownloader(constructStreamResource(ReportExportType.EXCEL));
        excelDownloader.extend(exportExcelBtn);
        exportExcelBtn.setIcon(FontAwesome.FILE_EXCEL_O);
        exportExcelBtn.setStyleName("link");
        popupButtonsControl.addComponent(exportExcelBtn);

        controlBtns.addComponent(exportButtonControl);
        controlBtns.setComponentAlignment(exportButtonControl, Alignment.TOP_RIGHT);
        controlBtns.setComponentAlignment(backBtn, Alignment.TOP_LEFT);
        controlBtns.setSizeFull();

        this.timeTrackingWrapper = new VerticalLayout();
        this.timeTrackingWrapper.setWidth("100%");
        contentWrapper.addComponent(this.timeTrackingWrapper);

        Calendar date = new GregorianCalendar();
        date.set(Calendar.DAY_OF_MONTH, 1);

        fromDate = date.getTime();
        date.add(Calendar.DAY_OF_MONTH, date.getActualMaximum(Calendar.DAY_OF_MONTH));
        toDate = date.getTime();

        fromDateField.setValue(fromDate);
        toDateField.setValue(toDate);

        searchCriteria = new ItemTimeLoggingSearchCriteria();

        searchCriteria.setRangeDate(new RangeDateSearchField(fromDate, toDate));
    } else {
        final Button backBtn = new Button("Back to Workboard");
        backBtn.addClickListener(new Button.ClickListener() {
            private static final long serialVersionUID = 1L;

            @Override
            public void buttonClick(final ClickEvent event) {
                EventBusFactory.getInstance()
                        .post(new ShellEvent.GotoProjectModule(TimeTrackingSummaryViewImpl.this, null));

            }
        });

        backBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
        backBtn.setIcon(FontAwesome.ARROW_LEFT);

        VerticalLayout contentWrapper = new VerticalLayout();
        contentWrapper.setSpacing(true);

        Label infoLbl = new Label("You are not involved in any project yet to track time working");
        infoLbl.setWidthUndefined();
        contentWrapper.setMargin(true);
        contentWrapper.addComponent(infoLbl);
        contentWrapper.setComponentAlignment(infoLbl, Alignment.MIDDLE_CENTER);

        contentWrapper.addComponent(backBtn);
        contentWrapper.setComponentAlignment(backBtn, Alignment.MIDDLE_CENTER);
        this.addComponent(contentWrapper);
        this.setComponentAlignment(contentWrapper, Alignment.MIDDLE_CENTER);
    }
}

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

License:Open Source License

@Override
public void initContent() {
    removeAllComponents();/*  w w w . ja v  a 2 s .com*/
    MHorizontalLayout header = new MHorizontalLayout().withFullWidth();

    ELabel layoutHeader = ELabel
            .h2(FontAwesome.EYE.getHtml() + " "
                    + UserUIContext.getMessage(FollowerI18nEnum.OPT_MY_FOLLOWING_TICKETS, 0))
            .withWidthUndefined();

    Button exportBtn = new Button(UserUIContext.getMessage(GenericI18Enum.ACTION_EXPORT),
            clickEvent -> exportButtonControl.setPopupVisible(true));
    exportButtonControl = new SplitButton(exportBtn);
    exportButtonControl.addStyleName(WebThemes.BUTTON_OPTION);
    exportButtonControl.setIcon(FontAwesome.EXTERNAL_LINK);

    OptionPopupContent popupButtonsControl = new OptionPopupContent();
    exportButtonControl.setContent(popupButtonsControl);

    Button exportPdfBtn = new Button(UserUIContext.getMessage(FileI18nEnum.PDF));
    FileDownloader pdfDownloader = new FileDownloader(constructStreamResource(ReportExportType.PDF));
    pdfDownloader.extend(exportPdfBtn);
    exportPdfBtn.setIcon(FontAwesome.FILE_PDF_O);
    popupButtonsControl.addOption(exportPdfBtn);

    Button exportExcelBtn = new Button(UserUIContext.getMessage(FileI18nEnum.EXCEL));
    FileDownloader excelDownloader = new FileDownloader(constructStreamResource(ReportExportType.EXCEL));
    excelDownloader.extend(exportExcelBtn);
    exportExcelBtn.setIcon(FontAwesome.FILE_EXCEL_O);
    popupButtonsControl.addOption(exportExcelBtn);

    header.with(layoutHeader, exportButtonControl).withAlign(layoutHeader, Alignment.MIDDLE_LEFT)
            .withAlign(exportButtonControl, Alignment.MIDDLE_RIGHT);
    this.addComponent(layoutHeader);

    searchPanel = new FollowingTicketSearchPanel();
    this.addComponent(searchPanel);

    this.ticketTable = new FollowingTicketTableDisplay();
    this.ticketTable.setMargin(new MarginInfo(true, false, false, false));
    this.addComponent(this.ticketTable);
}

From source file:org.lucidj.ui.gauss.GaussUI.java

License:Apache License

private void initToolbarArea() {
    hToolbarArea.setStyleName("ui-toolbar-area");
    hToolbarArea.setSizeUndefined();/* w  w w .j a  va  2s . c om*/
    hToolbarArea.setWidth("100%");

    CssLayout home_buttons = new CssLayout();
    home_buttons.setStyleName("ui-toolbar-area-home");
    home_buttons.setWidth(get_default_left_panel_width(), Sizeable.Unit.PIXELS);
    home_buttons.setId("_home_buttons");

    final Button toggle_menu = new Button();
    toggle_menu.setWidth(3, Unit.EM);
    toggle_menu.setIcon(FontAwesome.CHEVRON_DOWN);
    toggle_menu.addStyleName("tiny");
    toggle_menu.addStyleName("link");
    toggle_menu.addStyleName("ui-toolbar-spacer");
    toggle_menu.addStyleName("ui-toggle-button");
    toggle_menu.setId("_toggle_menu");
    home_buttons.addComponent(toggle_menu);

    toggle_menu.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            if (!hsMenuContents.isLocked()) {
                default_left_panel_width_px = (int) hsMenuContents.getSplitPosition();
                acMenu.setVisible(false);
                hsMenuContents.setMinSplitPosition(0, Unit.PIXELS);
                hsMenuContents.setSplitPosition(0, Sizeable.Unit.PIXELS);
                toggle_menu.setIcon(FontAwesome.CHEVRON_RIGHT);
                hsMenuContents.setLocked(true);
            } else {
                hsMenuContents.setLocked(false);
                acMenu.setVisible(true);
                hsMenuContents.setMinSplitPosition(MIN_LEFT_PANEL_WIDTH_PX, Unit.PIXELS);
                hsMenuContents.setSplitPosition(get_default_left_panel_width(), Unit.PIXELS);
                toggle_menu.setIcon(FontAwesome.CHEVRON_DOWN);
            }
        }
    });

    final Button home = new Button("Home");
    home.setIcon(FontAwesome.HOME);
    home.addStyleName("tiny");
    home.addStyleName("ui-toolbar-spacer");
    home.addStyleName("ui-toggle-button");
    home.setId("_home");
    home_buttons.addComponent(home);

    home.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            navigator.navigateTo("home");
        }
    });

    final Button new_button = new Button("New");
    new_button.setIcon(FontAwesome.EDIT);
    new_button.addStyleName("tiny");
    new_button.addStyleName("primary");
    new_button.addStyleName("ui-toggle-button");
    new_button.setId("_new");
    home_buttons.addComponent(new_button);
    new_button.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            navigator.navigateTo("new");
        }
    });

    hToolbarArea.addComponent(home_buttons);

    hToolbarPlaceholder = new CssLayout();
    hToolbarPlaceholder.setSizeFull();
    hToolbarArea.addComponent(hToolbarPlaceholder);
    hToolbarArea.setExpandRatio(hToolbarPlaceholder, 1.0f);

    final Button eject_view = new Button();
    eject_view.setIcon(FontAwesome.EXTERNAL_LINK);
    eject_view.addStyleName("tiny");
    eject_view.addStyleName("link");
    eject_view.addStyleName("ui-toggle-button");
    eject_view.setId("_eject_view");
    hToolbarArea.addComponent(eject_view);

    eject_view.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            Notification.show("Not implemented", Notification.Type.HUMANIZED_MESSAGE);
        }
    });

    toggle_sidebar = new Button();
    toggle_sidebar.setWidth(3, Unit.EM);
    toggle_sidebar.addStyleName("tiny");
    toggle_sidebar.addStyleName("link");
    toggle_sidebar.addStyleName("ui-toolbar-spacer");
    toggle_sidebar.addStyleName("ui-toggle-button");
    toggle_sidebar.setId("_toggle_sidebar");
    hToolbarArea.addComponent(toggle_sidebar);

    toggle_sidebar.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            show_sidebar(!sidebar_visible());
        }
    });
}