001 package railo.runtime.tag; 002 003 import javax.servlet.jsp.JspException; 004 005 import railo.runtime.exp.ApplicationException; 006 import railo.runtime.exp.TagNotSupported; 007 import railo.runtime.ext.tag.TagImpl; 008 import railo.runtime.type.dt.DateTime; 009 import railo.runtime.type.util.ListUtil; 010 011 public final class Calendar extends TagImpl { 012 013 private static final String[] DAY_NAMES_DEFAULT = new String[]{"S", "M", "T", "W", "Th", "F", "S"}; 014 015 private static final String[] MONTH_NAMES_DEFAULT = new String[]{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; 016 017 private String name; 018 private int height=-1; 019 private int width=-1; 020 private DateTime selectedDate; 021 private DateTime startRange; 022 private DateTime endRange; 023 private boolean disabled; 024 private String mask="MM/DD/YYYY"; 025 private int firstDayOfWeek=0; 026 private String[] dayNames=DAY_NAMES_DEFAULT; 027 private String[] monthNames=MONTH_NAMES_DEFAULT; 028 private String style; 029 private boolean enabled=true; 030 private boolean visible=true; 031 private String tooltip; 032 private String onChange; 033 private String onBlur; 034 private String onFocus; 035 036 037 public Calendar() throws ApplicationException { 038 // TODO impl. tag Calendar 039 throw new TagNotSupported("Calendar"); 040 } 041 042 @Override 043 public void release() { 044 super.release(); 045 name=null; 046 height=-1; 047 width=-1; 048 selectedDate=null; 049 startRange=null; 050 endRange=null; 051 disabled=false; 052 mask="MM/DD/YYYY"; 053 firstDayOfWeek=0; 054 dayNames=DAY_NAMES_DEFAULT; 055 monthNames=MONTH_NAMES_DEFAULT; 056 style=null; 057 enabled=true; 058 visible=true; 059 tooltip=null; 060 onChange=null; 061 onBlur=null; 062 onFocus=null; 063 } 064 065 @Override 066 public int doStartTag() throws JspException { 067 return super.doStartTag(); 068 } 069 070 /** 071 * @param dayNames the dayNames to set 072 */ 073 public void setDaynames(String listDayNames) { 074 this.dayNames = ListUtil.listToStringArray(listDayNames,','); 075 } 076 077 /** 078 * @param disabled the disabled to set 079 */ 080 public void setDisabled(boolean disabled) { 081 this.disabled = disabled; 082 } 083 084 /** 085 * @param enabled the enabled to set 086 */ 087 public void setEnabled(boolean enabled) { 088 this.enabled = enabled; 089 } 090 091 /** 092 * @param endRange the endRange to set 093 */ 094 public void setEndrange(DateTime endRange) { 095 this.endRange = endRange; 096 } 097 098 /** 099 * @param firstDayOfWeek the firstDayOfWeek to set 100 */ 101 public void setFirstdayofweek(double firstDayOfWeek) { 102 this.firstDayOfWeek = (int)firstDayOfWeek; 103 } 104 105 /** 106 * @param height the height to set 107 */ 108 public void setHeight(double height) { 109 this.height = (int)height; 110 } 111 112 /** 113 * @param mask the mask to set 114 */ 115 public void setMask(String mask) { 116 this.mask = mask; 117 } 118 119 /** 120 * @param monthNames the monthNames to set 121 */ 122 public void setMonthnames(String listMonthNames) { 123 this.monthNames = monthNames; 124 } 125 126 /** 127 * @param name the name to set 128 */ 129 public void setName(String name) { 130 this.name = name; 131 } 132 133 /** 134 * @param onBlur the onBlur to set 135 */ 136 public void setOnblur(String onBlur) { 137 this.onBlur = onBlur; 138 } 139 140 /** 141 * @param onChange the onChange to set 142 */ 143 public void setOnchange(String onChange) { 144 this.onChange = onChange; 145 } 146 147 /** 148 * @param onFocus the onFocus to set 149 */ 150 public void setOnfocus(String onFocus) { 151 this.onFocus = onFocus; 152 } 153 154 /** 155 * @param selectedDate the selectedDate to set 156 */ 157 public void setSelecteddate(DateTime selectedDate) { 158 this.selectedDate = selectedDate; 159 } 160 161 /** 162 * @param startRange the startRange to set 163 */ 164 public void setStartrange(DateTime startRange) { 165 this.startRange = startRange; 166 } 167 168 /** 169 * @param style the style to set 170 */ 171 public void setStyle(String style) { 172 this.style = style; 173 } 174 175 /** 176 * @param tooltip the tooltip to set 177 */ 178 public void setTooltip(String tooltip) { 179 this.tooltip = tooltip; 180 } 181 182 /** 183 * @param visible the visible to set 184 */ 185 public void setVisible(boolean visible) { 186 this.visible = visible; 187 } 188 189 /** 190 * @param width the width to set 191 */ 192 public void setWidth(double width) { 193 this.width = (int)width; 194 } 195 196 }