001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (C) Alkacon Software (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.galleries.shared; 029 030import com.google.gwt.user.client.rpc.IsSerializable; 031 032/** 033 * Bean class which represents an option for the site selector in the gallery dialog.<p> 034 */ 035public class CmsSiteSelectorOption implements IsSerializable { 036 037 /** Enum for indicating the site type. */ 038 public enum Type { 039 /** Current subsite. */ 040 currentSubsite, /** Root site. */ 041 root, /** Shared folder. */ 042 shared, /** Normally configured site. */ 043 site; 044 } 045 046 /** Flag which indicates whether this site is the current site. */ 047 private boolean m_isCurrentSite; 048 049 /** The message to display for this site. */ 050 private String m_message; 051 052 /** The site root of this site. */ 053 private String m_siteRoot; 054 055 /** The type of site. */ 056 private Type m_type; 057 058 /** 059 * Default constructor.<p> 060 */ 061 public CmsSiteSelectorOption() { 062 063 // do nothing 064 } 065 066 /** 067 * Creates a new site selector option.<p> 068 * 069 * @param type the site type 070 * @param siteRoot the site root 071 * @param isCurrentSite true if this is the current site 072 * @param message the message to display for this site 073 */ 074 public CmsSiteSelectorOption(Type type, String siteRoot, boolean isCurrentSite, String message) { 075 076 m_type = type; 077 m_siteRoot = siteRoot; 078 m_isCurrentSite = isCurrentSite; 079 m_message = message; 080 } 081 082 /** 083 * Gets the message to display for this site.<p> 084 * 085 * @return the message to display for this site 086 */ 087 public String getMessage() { 088 089 return m_message; 090 } 091 092 /** 093 * Gets the site root for the site.<p> 094 * 095 * @return the site root 096 */ 097 public String getSiteRoot() { 098 099 return m_siteRoot; 100 } 101 102 /** 103 * Gets the type of the site.<p> 104 * 105 * @return the type of the site 106 */ 107 public Type getType() { 108 109 return m_type; 110 } 111 112 /** 113 * Returns true if this site is the current site.<p> 114 * 115 * @return true if this is the current site 116 */ 117 public boolean isCurrentSite() { 118 119 return m_isCurrentSite; 120 } 121}