001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.ui.apps.user;
029
030import org.opencms.report.A_CmsReportThread;
031import org.opencms.ui.CmsVaadinUtils;
032import org.opencms.ui.components.CmsBasicDialog;
033import org.opencms.ui.report.CmsReportWidget;
034
035import com.vaadin.ui.Button;
036import com.vaadin.ui.VerticalLayout;
037
038/**
039 * Dialog for reports.<p>
040 */
041public class CmsShowReportDialog extends CmsBasicDialog {
042
043    /**vaadin serial id. */
044    private static final long serialVersionUID = 1267691928074775090L;
045
046    /**
047     * Public constructor.<p>
048     *
049     * @param thread to be shown
050     * @param close Runnable run on close click
051     */
052    public CmsShowReportDialog(A_CmsReportThread thread, Runnable close) {
053
054        setHeight(CmsImportExportUserDialog.DIALOG_HEIGHT);
055        VerticalLayout panel = new VerticalLayout();
056        panel.setSizeFull();
057        CmsReportWidget widget = new CmsReportWidget(thread);
058        widget.setSizeFull();
059        panel.addComponent(widget);
060        setContent(panel);
061
062        Button closeButton = new Button(CmsVaadinUtils.messageClose());
063        closeButton.addClickListener(event -> close.run());
064        addButton(closeButton, true);
065
066    }
067
068}