001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (C) Alkacon Software (https://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: https://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: https://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, 041 /** Root site. */ 042 root, 043 /** Shared folder. */ 044 shared, 045 /** Normally configured site. */ 046 site; 047 } 048 049 /** Flag which indicates whether this site is the current site. */ 050 private boolean m_isCurrentSite; 051 052 /** The message to display for this site. */ 053 private String m_message; 054 055 /** The site root of this site. */ 056 private String m_siteRoot; 057 058 /** The type of site. */ 059 private Type m_type; 060 061 /** 062 * Default constructor.<p> 063 */ 064 public CmsSiteSelectorOption() { 065 066 // do nothing 067 } 068 069 /** 070 * Creates a new site selector option.<p> 071 * 072 * @param type the site type 073 * @param siteRoot the site root 074 * @param isCurrentSite true if this is the current site 075 * @param message the message to display for this site 076 */ 077 public CmsSiteSelectorOption(Type type, String siteRoot, boolean isCurrentSite, String message) { 078 079 m_type = type; 080 m_siteRoot = siteRoot; 081 m_isCurrentSite = isCurrentSite; 082 m_message = message; 083 } 084 085 /** 086 * Gets the message to display for this site.<p> 087 * 088 * @return the message to display for this site 089 */ 090 public String getMessage() { 091 092 return m_message; 093 } 094 095 /** 096 * Gets the site root for the site.<p> 097 * 098 * @return the site root 099 */ 100 public String getSiteRoot() { 101 102 return m_siteRoot; 103 } 104 105 /** 106 * Gets the type of the site.<p> 107 * 108 * @return the type of the site 109 */ 110 public Type getType() { 111 112 return m_type; 113 } 114 115 /** 116 * Returns true if this site is the current site.<p> 117 * 118 * @return true if this is the current site 119 */ 120 public boolean isCurrentSite() { 121 122 return m_isCurrentSite; 123 } 124}