KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > ui > core > tags > calendar > CalendarModel


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. The ASF licenses this file to You
4  * under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License. For additional information regarding
15  * copyright in this work, please see the NOTICE file in the top level
16  * directory of this distribution.
17  */

18
19 package org.apache.roller.ui.core.tags.calendar;
20 import java.util.Calendar JavaDoc;
21 import java.util.Date JavaDoc;
22
23 /**
24  * Model interface for the CalendarTag. The CalendarTag will set a day,
25  * then use the computeUrl method to get the URLs it needs.
26  */

27 public interface CalendarModel {
28     public Calendar JavaDoc getCalendar();
29     
30     public void setDay( String JavaDoc month ) throws Exception JavaDoc;
31     
32     public Date JavaDoc getDay();
33     
34     public Date JavaDoc getNextMonth();
35     
36     public String JavaDoc computePrevMonthUrl();
37     
38     public String JavaDoc computeTodayMonthUrl();
39     
40     public String JavaDoc computeNextMonthUrl();
41     
42     /**
43      * Create URL for use on edit-weblog page, preserves the request
44      * parameters used by the tabbed-menu tag for navigation.
45      *
46      * @param day Day for URL
47      * @param monthURL True to return month URL (6-char date)
48      * @param valid Always return a URL, never return null
49      * @return URL for day, or null if no weblog entry on that day
50      */

51     public String JavaDoc computeUrl( java.util.Date JavaDoc day, boolean monthURL, boolean valid );
52     
53     /**
54      * Get calendar cell content or null if none.
55      *
56      * @param day Day for URL
57      * @param valid Always return a URL, never return null
58      * @return Calendar cell content or null if none.
59      */

60     public String JavaDoc getContent( java.util.Date JavaDoc day );
61 }
62
63
Popular Tags