001/* 002 * Copyright 2010 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.cms.contenttype; 017 018import org.ametys.runtime.i18n.I18nizableText; 019 020/** 021 * Repeater definition. 022 */ 023public class RepeaterDefinition extends MetadataDefinition 024{ 025 private int _initializeSize; 026 private int _minSize; 027 private int _maxSize; 028 private I18nizableText _addLabel; 029 private I18nizableText _delLabel; 030 private String _headerLabel; 031 032 /** 033 * Retrieves the initial size. 034 * @return the initial size. 035 */ 036 public int getInitialSize() 037 { 038 return _initializeSize; 039 } 040 041 /** 042 * Set the initial size. 043 * @param size the initial size. 044 */ 045 public void setInitialSize(int size) 046 { 047 _initializeSize = size; 048 } 049 050 /** 051 * Retrieves the minimum size. 052 * @return the minimum size. 053 */ 054 public int getMinSize() 055 { 056 return _minSize; 057 } 058 059 /** 060 * Set the minimum size. 061 * @param size the minimum size. 062 */ 063 public void setMinSize(int size) 064 { 065 _minSize = size; 066 } 067 068 /** 069 * Retrieves the maximum size. 070 * @return the maximum size or <code>-1</code> if unbounded. 071 */ 072 public int getMaxSize() 073 { 074 return _maxSize; 075 } 076 077 /** 078 * Set the maximum size. 079 * @param size the maximum size or <code>-1</code> if unbounded. 080 */ 081 public void setMaxSize(int size) 082 { 083 _maxSize = size; 084 } 085 086 /** 087 * Retrieves the add label. 088 * @return the add label or <code>null</code> if none. 089 */ 090 public I18nizableText getAddLabel() 091 { 092 return _addLabel; 093 } 094 095 /** 096 * Set the add label. 097 * @param label the add label or <code>null</code> if none. 098 */ 099 public void setAddLabel(I18nizableText label) 100 { 101 _addLabel = label; 102 } 103 104 /** 105 * Retrieves the delete label. 106 * @return the delete label or <code>null</code> if none. 107 */ 108 public I18nizableText getDeleteLabel() 109 { 110 return _delLabel; 111 } 112 113 /** 114 * Set the delete label. 115 * @param label the delete label or <code>null</code> if none. 116 */ 117 public void setDeleteLabel(I18nizableText label) 118 { 119 _delLabel = label; 120 } 121 122 /** 123 * Get the header label. 124 * @return the header label or <code>null</code> if none. 125 */ 126 public String getHeaderLabel() 127 { 128 return _headerLabel; 129 } 130 131 /** 132 * Set the header label. 133 * @param label the header label or <code>null</code> if none. 134 */ 135 public void setHeaderLabel(String label) 136 { 137 _headerLabel = label; 138 } 139 140 @Override 141 public String toString() 142 { 143 return "REPEATER " + super.toString(); 144 } 145}