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.git; 029 030import org.opencms.ui.CmsVaadinUtils; 031import org.opencms.ui.components.CmsBasicDialog; 032import org.opencms.ui.components.OpenCmsTheme; 033 034import java.util.List; 035 036import com.vaadin.v7.shared.ui.label.ContentMode; 037import com.vaadin.ui.Button; 038import com.vaadin.v7.ui.Label; 039import com.vaadin.ui.themes.ValoTheme; 040 041/** Dialog that prints the result of the execution of a git action. */ 042public class CmsGitActionResultPanel extends CmsBasicDialog { 043 044 /** Serial version id. */ 045 private static final long serialVersionUID = 1L; 046 047 /** Label showing the result message. */ 048 private Label m_messageLabel; 049 /** Label showing the log output. */ 050 private Label m_logLabel; 051 052 /** 053 * Creates a dialog window with the git action result. 054 * @param message the message written at top. 055 * @param log the log output 056 * @param isError flag, indicating if an error occurred. 057 * @param buttons the buttons to show at the bottom of the dialog. 058 */ 059 public CmsGitActionResultPanel(String message, String log, boolean isError, List<Button> buttons) { 060 CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null); 061 m_logLabel.setContentMode(ContentMode.PREFORMATTED); 062 if (isError) { 063 m_messageLabel.addStyleName(OpenCmsTheme.LABEL_ERROR); 064 } 065 m_messageLabel.setValue(message); 066 m_logLabel.setValue(log); 067 for (Button button : buttons) { 068 addButton(button); 069 } 070 m_messageLabel.addStyleName(ValoTheme.LABEL_H2); 071 } 072}