Source Code Cross Referenced for EventBean.java in  » Portal » Open-Portal » com » sun » portal » wireless » taglibs » cal » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.wireless.taglibs.cal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.portal.wireless.taglibs.cal;
002:
003:        import com.sun.comclient.calendar.VEvent;
004:        import com.sun.comclient.calendar.RecurrencePattern;
005:
006:        public class EventBean extends SchedulingBean implements  Comparable {
007:
008:            private VEvent theEvent;
009:            private String recurrenceModifier;
010:
011:            public EventBean(VEvent event) {
012:                super (event);
013:                this .theEvent = event;
014:            }
015:
016:            public VEvent getEvent() {
017:                return theEvent;
018:            }
019:
020:            /**
021:             * Get the Event Location. 
022:             * <br><br>
023:             *
024:             * @return location of this event  
025:             */
026:            public String getLocation() throws Exception {
027:                return theEvent.getLocation();
028:            }
029:
030:            /**
031:             * Set the Event Location.
032:             * <br><br>
033:             *
034:             * @param location location of this event 
035:             */
036:            public void setLocation(String location) throws Exception {
037:                theEvent.setLocation(location);
038:            }
039:
040:            /**
041:             * Test is the event is all day or not.
042:             * <br><br>
043:             *
044:             * @return   True if the event is all day.
045:             */
046:            public boolean isAllDay() throws Exception {
047:                if (theEvent.getStart() != null) {
048:                    return theEvent.isAllDay();
049:                }
050:                return true;
051:            }
052:
053:            /**
054:             * Sets whether the event is all day or not.
055:             * <br><br>
056:             *
057:             * @param   allday   True if the event is all day.
058:             */
059:            public void setAllDay(boolean allday) throws Exception {
060:                theEvent.setAllDay(allday);
061:            }
062:
063:            /**
064:             * Gets if this calendarId is same as the Organizer's(it's calId) 
065:             * Used to identify if this guy is the organizer or an attendee 
066:             * @return true if the organizer's calid and this calenadrId are same
067:             * false otherwise
068:             *
069:             *TBD#4510789 needs to be fixed for pimAdapter
070:             */
071:            public boolean isCalIdTheOrganizer() throws Exception {
072:                boolean result = true;
073:                if (!isNew()) {
074:                    String calId = theEvent.getCalID();
075:                    result = theEvent.isCalIdTheOrganizer(calId);
076:                }
077:                return result;
078:            }
079:
080:            /**
081:             * Returns whether the theEvent is part of a recurrence.
082:             * <br><br>
083:             *
084:             * @return true if the theEvent repeats
085:             */
086:            public boolean isRecurrence() throws Exception {
087:                return theEvent.isRecurring();
088:            }
089:
090:            /**
091:             * Returns the recurrence pattern for this theEvent. 
092:             * <br><br>
093:             *
094:             * @return the first recurrence pattern object, 
095:             * null if does not exist
096:             */
097:            public RecurrencePattern getRecurrencePattern() throws Exception {
098:                if (theEvent.getRecurrenceRules() != null
099:                        && theEvent.getRecurrenceRules().length > 0) {
100:                    return theEvent.getRecurrenceRules()[0];
101:                }
102:                return null;
103:            }
104:
105:            /**
106:             * Set the recurrence pattern for this theEvent. 
107:             * Beware: Removes all the existing rules 
108:             * and sets this rule as the first one
109:             * <br><br>
110:             *
111:             * @param rPattern recurrence pattern for this theEvent
112:             */
113:            public void setRecurrencePattern(RecurrencePattern rPattern)
114:                    throws Exception {
115:                //Presently we are supporting only one recurrenceRule from our GUI
116:                RecurrencePattern[] rules = theEvent.getRecurrenceRules();
117:                if (rules != null && rules.length > 0) {
118:                    theEvent.removeAllRecurrenceRules();
119:                }
120:                theEvent.addRecurrenceRule(rPattern);
121:            }
122:
123:            /**
124:             * Gets the recurrenceModifier option set in the Event
125:             * Used while updating this event.
126:             * @return the string value of the recurrenceModifier 
127:             * that has been set before.
128:             */
129:
130:            public String getRecurrenceModifier() {
131:                return recurrenceModifier;
132:            }
133:
134:            /**
135:             * Gets the recurrenceModifier option set in the Event
136:             * Used while updating this event.
137:             * @return the string value of the recurrenceModifier 
138:             * that has been set before.
139:             */
140:            public String getModifier() {
141:                return getRecurrenceModifier();
142:            }
143:
144:            /**
145:             * Sets the recurrenceModifier option  in the Event
146:             * Used while updating this event.
147:             * @param the string value of the recurrenceModifier 
148:             * that needs to be  set.
149:             */
150:            public void setRecurrenceModifier(String mod) {
151:                recurrenceModifier = mod;
152:                ;
153:            }
154:
155:            /**
156:             * Sets the recurrenceModifier option  in the Event
157:             * Used while updating this event.
158:             * @param the string value of the recurrenceModifier 
159:             * that needs to be  set.
160:             */
161:            public void setModifier(String mod) {
162:                setRecurrenceModifier(mod);
163:            }
164:
165:            /**
166:             * Test is the event has conflicting event
167:             * This just checks for the property isConflict exist and if it is true
168:             * 
169:             * <br><br>
170:             *
171:             * @return   True if the event is conflict 
172:             */
173:            public boolean isConflict() {
174:                boolean conflicted = false;
175:                if (theEvent.hasProperty("isConflict")) {
176:                    conflicted = new Boolean((String) theEvent
177:                            .getProperty("isConflict")).booleanValue();
178:                }
179:                return conflicted;
180:            }
181:
182:            /**
183:             * Sets weather the event is conflict 
184:             * Invoked by Fetch to set it
185:             * <br><br>
186:             *
187:             * @param   conflict    True if the event is conflict.
188:             */
189:            public void setConflict(boolean conflict) {
190:                theEvent.setProperty("isConflict", String.valueOf(conflict));
191:            }
192:
193:            /**
194:             * This is requied for comparable
195:             */
196:
197:            public int compareTo(Object o) {
198:                int result = -1;
199:                try {
200:                    if (o instanceof  EventBean) {
201:                        EventBean eventObj = (EventBean) o;
202:                        if (getStart().before(eventObj.getStart())) {
203:                            result = -1;
204:                            //When returns 0 , TreeSet does not add to the Collection
205:                        } else {
206:                            result = 1;
207:                        }
208:                    }
209:                } catch (Exception ex) {
210:                    ex.printStackTrace();
211:                }
212:                return result;
213:            }
214:
215:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.