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.ade.publish.client; 029 030/** 031 * A bean containing statistics about the states of publish items in the publish dialog.<p> 032 * 033 * This is used for updating the check box states in the publish dialog.<p> 034 * 035 */ 036public class CmsPublishItemStateSummary { 037 038 /** The counts for the normal state. */ 039 private int m_normalCount; 040 /** The count for the publish state. */ 041 private int m_publishCount; 042 043 /** The count for the remove state. */ 044 private int m_removeCount; 045 046 /** 047 * Adds a new state value to the statistics.<p> 048 * 049 * @param state the state to add 050 */ 051 public void addState(CmsPublishItemStatus.State state) { 052 053 switch (state) { 054 case normal: 055 m_normalCount += 1; 056 break; 057 case publish: 058 m_publishCount += 1; 059 break; 060 case remove: 061 default: 062 m_removeCount += 1; 063 break; 064 } 065 } 066 067 /** 068 * Gets the count of 'normal' states.<p> 069 * 070 * @return the count 071 */ 072 public int getNormalCount() { 073 074 return m_normalCount; 075 } 076 077 /** 078 * Gets the count of 'publish' states.<p> 079 * 080 * @return the count 081 */ 082 public int getPublishCount() { 083 084 return m_publishCount; 085 } 086 087 /** 088 * Gets the count of 'remove' states.<p> 089 * 090 * @return the count 091 */ 092 public int getRemoveCount() { 093 094 return m_removeCount; 095 } 096 097}