SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 259 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

apache.tapestry.SelectModel;
import org.apache.tapestry.ValueEncoder;
import org.apache.tapestry.annotations.Inject;
import org.apache.tapestry.annotations.Parameter;
import org.apache.tapestry.annotations.SetupRender;
import org.apache.tapestry.ioc.Messages;
import org.apache.tapestry.util.EnumSelectModel;
public class DateInput
{
@Parameter(required = true)
private Date date;
@Inject
private Messages messages;
private Calendar c = Calendar.getInstance();
@SetupRender
void setupCalendar()
{
c.setTime(date == null ? new Date() : date);
}
public SelectModel getDayModel()
{
return new IntegerSelectModel(1, 31);
Creating Custom Components
[ 216 ]
}
public SelectModel getYearModel()
{
return new IntegerSelectModel(1900, 2010);
}
public SelectModel getMonthModel()
{
return new EnumSelectModel(Month.class, messages);
}
public ValueEncoder getEncoder()
{
return new IntegerEncoder();
}
public int getDay()
{
return c.get(Calendar.DATE);
}
public void setDay(int day)
{
c.set(Calendar.DATE, day);
}
public Month getMonth()
{
return Month.values()[c.get(Calendar.MONTH)];
}
public void setMonth(Month month)
{
c.set(Calendar.MONTH, month.getOrder());
}
public int getYear()
{
return c.


Pages:
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
forum komputerowe kredyt gotówkowy ge bank kredyt mieszkaniowy Pudełka plastikowe Na czym polega pozycjonowanie