You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by jl...@apache.org on 2006/04/07 16:23:58 UTC
svn commit: r392301 - in
/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule:
./ renderer/
Author: jlust
Date: Fri Apr 7 07:23:48 2006
New Revision: 392301
URL: http://svn.apache.org/viewcvs?rev=392301&view=rev
Log:
formatting, commenting and cleanup of schedule classes
Modified:
myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlPlanner.java
myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlSchedule.java
myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleMouseEvent.java
myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java
myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UIPlanner.java
myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UISchedule.java
myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java
myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlPlanner.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlPlanner.java?rev=392301&r1=392300&r2=392301&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlPlanner.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlPlanner.java Fri Apr 7 07:23:48 2006
@@ -16,28 +16,25 @@
package org.apache.myfaces.custom.schedule;
-
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import org.apache.myfaces.component.UserRoleAware;
import org.apache.myfaces.shared_tomahawk.util._ComponentUtils;
-
/**
*
* @author Bruno Aranda (latest modification by $Author$)
* @version $Revision$
*/
-public class HtmlPlanner
- extends UIPlanner
- implements UserRoleAware
- {
+public class HtmlPlanner extends UIPlanner implements UserRoleAware
+{
-// ------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+ // ------------------ GENERATED CODE BEGIN (do not modify!) --------------------
- public static final String COMPONENT_TYPE = "org.apache.myfaces.Planner";
+ private static final long serialVersionUID = 4985214318279622233L;
public static final String COMPONENT_FAMILY = "javax.faces.Panel";
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.Planner";
private static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Planner";
private String _enabledOnUserRole = null;
@@ -48,37 +45,53 @@
setRendererType(DEFAULT_RENDERER_TYPE);
}
- public String getFamily()
- {
- return COMPONENT_FAMILY;
- }
-
- public void setEnabledOnUserRole(String enabledOnUserRole)
- {
- _enabledOnUserRole = enabledOnUserRole;
- }
-
+ /**
+ * @see org.apache.myfaces.component.UserRoleAware#getEnabledOnUserRole()
+ */
public String getEnabledOnUserRole()
{
- if (_enabledOnUserRole != null) return _enabledOnUserRole;
+ if (_enabledOnUserRole != null)
+ return _enabledOnUserRole;
ValueBinding vb = getValueBinding("enabledOnUserRole");
- return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
+ return vb != null ? _ComponentUtils.getStringValue(getFacesContext(),
+ vb) : null;
}
- public void setVisibleOnUserRole(String visibleOnUserRole)
+ /**
+ * @see javax.faces.component.UIComponent#getFamily()
+ */
+ public String getFamily()
{
- _visibleOnUserRole = visibleOnUserRole;
+ return COMPONENT_FAMILY;
}
+ /**
+ * @see org.apache.myfaces.component.UserRoleAware#getVisibleOnUserRole()
+ */
public String getVisibleOnUserRole()
{
- if (_visibleOnUserRole != null) return _visibleOnUserRole;
+ if (_visibleOnUserRole != null)
+ return _visibleOnUserRole;
ValueBinding vb = getValueBinding("visibleOnUserRole");
- return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
+ return vb != null ? _ComponentUtils.getStringValue(getFacesContext(),
+ vb) : null;
}
+ /**
+ * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
+ */
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[]) state;
+ super.restoreState(context, values[0]);
+ _enabledOnUserRole = (String) values[1];
+ _visibleOnUserRole = (String) values[2];
+ }
+ // ------------------ GENERATED CODE END ---------------------------------------
-
+ /**
+ * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
+ */
public Object saveState(FacesContext context)
{
Object values[] = new Object[3];
@@ -88,14 +101,21 @@
return ((Object) (values));
}
- public void restoreState(FacesContext context, Object state)
+ /**
+ * @see org.apache.myfaces.component.UserRoleAware#setEnabledOnUserRole(java.lang.String)
+ */
+ public void setEnabledOnUserRole(String enabledOnUserRole)
{
- Object values[] = (Object[])state;
- super.restoreState(context, values[0]);
- _enabledOnUserRole = (String)values[1];
- _visibleOnUserRole = (String)values[2];
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ /**
+ * @see org.apache.myfaces.component.UserRoleAware#setVisibleOnUserRole(java.lang.String)
+ */
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
}
-// ------------------ GENERATED CODE END ---------------------------------------
-
+
}
//The End
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlSchedule.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlSchedule.java?rev=392301&r1=392300&r2=392301&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlSchedule.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/HtmlSchedule.java Fri Apr 7 07:23:48 2006
@@ -16,7 +16,6 @@
package org.apache.myfaces.custom.schedule;
-
import java.util.Date;
import javax.faces.context.FacesContext;
@@ -26,97 +25,90 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.component.UserRoleAware;
-import org.apache.myfaces.custom.schedule.model.ScheduleEntry;
import org.apache.myfaces.custom.schedule.util.ScheduleUtil;
import org.apache.myfaces.shared_tomahawk.util._ComponentUtils;
-
/**
*
* @author Bruno Aranda (latest modification by $Author$)
* @author Jurgen Lust
* @version $Revision$
*/
-public class HtmlSchedule
- extends UISchedule implements UserRoleAware
+public class HtmlSchedule extends UISchedule implements UserRoleAware
{
-// ------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+ public static final String COMPONENT_FAMILY = "javax.faces.Panel";
public static final String COMPONENT_TYPE = "org.apache.myfaces.Schedule";
- public static final String COMPONENT_FAMILY = "javax.faces.Panel";
private static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Schedule";
+ private static final long serialVersionUID = 5859593107442371656L;
+ // ------------------ GENERATED CODE BEGIN (do not modify!) --------------------
private String _enabledOnUserRole = null;
- private String _visibleOnUserRole = null;
- private Boolean _submitOnClick = null;
private Date _lastClickedDateAndTime = null;
private MethodBinding _mouseListener = null;
+ private Boolean _submitOnClick = null;
+ private String _visibleOnUserRole = null;
public HtmlSchedule()
{
setRendererType(DEFAULT_RENDERER_TYPE);
}
- public String getFamily()
+ /**
+ * @see javax.faces.component.UIComponent#broadcast(javax.faces.event.FacesEvent)
+ */
+ public void broadcast(FacesEvent event) throws AbortProcessingException
{
- return COMPONENT_FAMILY;
- }
+ // First invoke the mouse listener, before any other listener
+ if (event instanceof ScheduleMouseEvent)
+ {
+ FacesContext context = getFacesContext();
+ ScheduleMouseEvent mouseEvent = (ScheduleMouseEvent) event;
+ MethodBinding mouseListenerBinding = getMouseListener();
- public void setEnabledOnUserRole(String enabledOnUserRole)
- {
- _enabledOnUserRole = enabledOnUserRole;
+ if (mouseListenerBinding != null)
+ {
+ mouseListenerBinding.invoke(context,
+ new Object[] { mouseEvent });
+ }
+ }
+ //now invoke the other listeners
+ super.broadcast(event);
}
+ /**
+ * @see org.apache.myfaces.component.UserRoleAware#getEnabledOnUserRole()
+ */
public String getEnabledOnUserRole()
{
- if (_enabledOnUserRole != null) return _enabledOnUserRole;
+ if (_enabledOnUserRole != null)
+ return _enabledOnUserRole;
ValueBinding vb = getValueBinding("enabledOnUserRole");
- return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
- }
-
- public void setVisibleOnUserRole(String visibleOnUserRole)
- {
- _visibleOnUserRole = visibleOnUserRole;
- }
-
- public String getVisibleOnUserRole()
- {
- if (_visibleOnUserRole != null) return _visibleOnUserRole;
- ValueBinding vb = getValueBinding("visibleOnUserRole");
- return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
+ return vb != null ? _ComponentUtils.getStringValue(getFacesContext(),
+ vb) : null;
}
/**
- * <p>
- * Should the parent form of this schedule be submitted when the user
- * clicks on a day? Note that this will only work when the readonly
- * property is set to false.
- * </p>
- *
- *
- * @param submitOnClick submit the form on mouse click
+ * @see javax.faces.component.UIComponent#getFamily()
*/
- public void setSubmitOnClick(boolean submitOnClick)
+ public String getFamily()
{
- this._submitOnClick = Boolean.valueOf(submitOnClick);
+ return COMPONENT_FAMILY;
}
/**
* <p>
- * Should the parent form of this schedule be submitted when the user
- * clicks on a day? Note that this will only work when the readonly
- * property is set to false.
+ * The last date and time of day that was clicked. This is set when
+ * submitOnClick is true, and the schedule is clicked by the user.
* </p>
- *
- * @return submit the form on mouse click
+ *
+ * @return the last clicked date and time
*/
- public boolean isSubmitOnClick()
+ public Date getLastClickedDateAndTime()
{
- return ScheduleUtil.getBooleanProperty(this, _submitOnClick, "submitOnClick", false);
+ return _lastClickedDateAndTime;
}
/**
@@ -128,65 +120,45 @@
}
/**
- * @param listener the method binding to the mouse listener method
+ * @see org.apache.myfaces.component.UserRoleAware#getVisibleOnUserRole()
*/
- public void setMouseListener(MethodBinding listener)
+ public String getVisibleOnUserRole()
{
- _mouseListener = listener;
+ if (_visibleOnUserRole != null)
+ return _visibleOnUserRole;
+ ValueBinding vb = getValueBinding("visibleOnUserRole");
+ return vb != null ? _ComponentUtils.getStringValue(getFacesContext(),
+ vb) : null;
}
-
/**
* <p>
- * The last date and time of day that was clicked. This is set when
- * submitOnClick is true, and the schedule is clicked by the user.
+ * Should the parent form of this schedule be submitted when the user
+ * clicks on a day? Note that this will only work when the readonly
+ * property is set to false.
* </p>
- *
- * @return the last clicked date and time
+ *
+ * @return submit the form on mouse click
*/
- public Date getLastClickedDateAndTime()
+ public boolean isSubmitOnClick()
{
- return _lastClickedDateAndTime;
+ return ScheduleUtil.getBooleanProperty(this, _submitOnClick,
+ "submitOnClick", false);
}
-
+
/**
- * <p>
- * The last date and time of day that was clicked. This is set when
- * submitOnClick is true, and the schedule is clicked by the user.
- * </p>
- *
- * @return the last clicked date and time
+ * @see javax.faces.component.UIComponent#queueEvent(javax.faces.event.FacesEvent)
*/
- public void setLastClickedDateAndTime(Date lastClickedDateAndTime)
- {
- this._lastClickedDateAndTime = lastClickedDateAndTime;
- }
-
- public void broadcast(FacesEvent event) throws AbortProcessingException
- {
- // First invoke the mouse listener, before any other listener
- if (event instanceof ScheduleMouseEvent)
- {
- FacesContext context = getFacesContext();
- ScheduleMouseEvent mouseEvent = (ScheduleMouseEvent) event;
- MethodBinding mouseListenerBinding = getMouseListener();
-
- if (mouseListenerBinding != null)
- {
- mouseListenerBinding.invoke(context, new Object[] { mouseEvent });
- }
- }
- //now invoke the other listeners
- super.broadcast(event);
- }
-
public void queueEvent(FacesEvent event)
{
if (event instanceof ScheduleMouseEvent)
{
- if (isImmediate()) {
+ if (isImmediate())
+ {
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else {
+ }
+ else
+ {
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
}
@@ -198,10 +170,31 @@
* resetting all mouse event variables that were left from the previous
* request
*/
- public void resetMouseEvents() {
+ public void resetMouseEvents()
+ {
this._lastClickedDateAndTime = null;
}
-
+
+ /**
+ * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
+ */
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[]) state;
+ super.restoreState(context, values[0]);
+ _enabledOnUserRole = (String) values[1];
+ _visibleOnUserRole = (String) values[2];
+ _submitOnClick = (Boolean) values[3];
+ _lastClickedDateAndTime = (Date) values[4];
+ _mouseListener = (MethodBinding) restoreAttachedState(context,
+ values[5]);
+ }
+
+ // ------------------ GENERATED CODE END ---------------------------------------
+
+ /**
+ * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
+ */
public Object saveState(FacesContext context)
{
Object values[] = new Object[6];
@@ -214,17 +207,54 @@
return ((Object) (values));
}
- public void restoreState(FacesContext context, Object state)
+ /**
+ * @see org.apache.myfaces.component.UserRoleAware#setEnabledOnUserRole(java.lang.String)
+ */
+ public void setEnabledOnUserRole(String enabledOnUserRole)
{
- Object values[] = (Object[])state;
- super.restoreState(context, values[0]);
- _enabledOnUserRole = (String)values[1];
- _visibleOnUserRole = (String)values[2];
- _submitOnClick = (Boolean)values[3];
- _lastClickedDateAndTime = (Date)values[4];
- _mouseListener = (MethodBinding)restoreAttachedState(context, values[5]);
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ /**
+ * <p>
+ * The last date and time of day that was clicked. This is set when
+ * submitOnClick is true, and the schedule is clicked by the user.
+ * </p>
+ *
+ * @return the last clicked date and time
+ */
+ public void setLastClickedDateAndTime(Date lastClickedDateAndTime)
+ {
+ this._lastClickedDateAndTime = lastClickedDateAndTime;
+ }
+
+ /**
+ * @param listener the method binding to the mouse listener method
+ */
+ public void setMouseListener(MethodBinding listener)
+ {
+ _mouseListener = listener;
+ }
+
+ /**
+ * <p>
+ * Should the parent form of this schedule be submitted when the user
+ * clicks on a day? Note that this will only work when the readonly
+ * property is set to false.
+ * </p>
+ *
+ *
+ * @param submitOnClick submit the form on mouse click
+ */
+ public void setSubmitOnClick(boolean submitOnClick)
+ {
+ this._submitOnClick = Boolean.valueOf(submitOnClick);
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
}
-// ------------------ GENERATED CODE END ---------------------------------------
}
//The End
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleMouseEvent.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleMouseEvent.java?rev=392301&r1=392300&r2=392301&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleMouseEvent.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleMouseEvent.java Fri Apr 7 07:23:48 2006
@@ -18,12 +18,8 @@
import java.io.Serializable;
import java.util.Date;
-import javax.faces.component.UIComponent;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
-import javax.faces.event.PhaseId;
-
-import org.apache.myfaces.custom.schedule.model.ScheduleEntry;
/**
* An event that is fired when the schedule is clicked, and the submitOnClick
@@ -38,43 +34,53 @@
public static final int SCHEDULE_BODY_CLICKED = 1;
public static final int SCHEDULE_HEADER_CLICKED = 2;
public static final int SCHEDULE_ENTRY_CLICKED = 3;
-
+
private static final long serialVersionUID = -2810582008938303475L;
-
+
private final int eventType;
- public ScheduleMouseEvent(final HtmlSchedule source, final int eventType) {
+ public ScheduleMouseEvent(final HtmlSchedule source, final int eventType)
+ {
super(source);
//the FacesEvent throws an IllegalArgumentException when source == null
//so don't bother here
this.eventType = eventType;
}
-
- /**
- * @return The schedule component where the mouse event originated
- */
- public HtmlSchedule getSchedule()
- {
- return (HtmlSchedule)getSource();
- }
- public Date getClickedTime() {
+ public Date getClickedDate()
+ {
return getSchedule().getLastClickedDateAndTime();
}
-
- public Date getClickedDate() {
+
+ public Date getClickedTime()
+ {
return getSchedule().getLastClickedDateAndTime();
}
-
- public int getEventType() {
+
+ public int getEventType()
+ {
return eventType;
}
-
+
+ /**
+ * @return The schedule component where the mouse event originated
+ */
+ public HtmlSchedule getSchedule()
+ {
+ return (HtmlSchedule) getSource();
+ }
+
+ /**
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
public boolean isAppropriateListener(FacesListener listener)
{
return (listener instanceof ScheduleMouseListener);
}
+ /**
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
public void processListener(FacesListener listener)
{
if (listener instanceof ScheduleMouseListener)
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java?rev=392301&r1=392300&r2=392301&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java Fri Apr 7 07:23:48 2006
@@ -23,9 +23,6 @@
import javax.faces.event.ActionEvent;
import javax.faces.webapp.UIComponentTag;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* <p>
* JSP tag for the schedule component
@@ -40,63 +37,64 @@
private String action;
private String actionListener;
- private String mouseListener;
+ private String backgroundClass;
+ private String columnClass;
private String compactMonthRowHeight;
private String compactWeekRowHeight;
+ private String contentClass;
+ private String dateClass;
+ private String dayClass;
private String detailedRowHeight;
+ private String entryClass;
+ private String entryRenderer;
+ private String evenClass;
+ private String foregroundClass;
+ private String freeClass;
+ private String gutterClass;
+ private String headerClass;
private String headerDateFormat;
+ private String holidayClass;
+ private String hoursClass;
private String immediate;
+ private String inactiveDayClass;
+ private String minutesClass;
+ private String monthClass;
+ private String mouseListener;
private String readonly;
private String rendered;
+ private String selectedClass;
+ private String selectedEntryClass;
private String submitOnClick;
+ private String subtitleClass;
+ private String textClass;
private String theme;
+ private String titleClass;
private String tooltip;
+ private String unevenClass;
private String value;
private String visibleEndHour;
private String visibleStartHour;
+ private String weekClass;
private String workingEndHour;
private String workingStartHour;
-
- private String columnClass;
- private String backgroundClass;
- private String freeClass;
- private String evenClass;
- private String unevenClass;
- private String gutterClass;
- private String headerClass;
- private String dateClass;
- private String holidayClass;
- private String hoursClass;
- private String minutesClass;
- private String selectedEntryClass;
- private String textClass;
- private String titleClass;
- private String subtitleClass;
- private String entryClass;
- private String foregroundClass;
-
- private String dayClass;
- private String inactiveDayClass;
- private String contentClass;
- private String selectedClass;
- private String monthClass;
- private String weekClass;
-
- private String entryRenderer;
-
//~ Methods ----------------------------------------------------------------
- /**
- * <p>
- * The action of the JSF component
- * </p>
- *
- * @param action The action to set.
- */
- public void setAction(String action)
+ private void addAttribute(Application app, UIComponent component,
+ String key, String value)
{
- this.action = action;
+ if ((key != null) && (value != null))
+ {
+ if (isValueReference(value))
+ {
+ component.setValueBinding(key, app
+ .createValueBinding((String) value));
+ }
+ else
+ {
+ component.getAttributes().put(key, value);
+ }
+ }
}
/**
@@ -116,18 +114,6 @@
* The actionlistener of the JSF component
* </p>
*
- * @param actionListener The actionListener to set.
- */
- public void setActionListener(String actionListener)
- {
- this.actionListener = actionListener;
- }
-
- /**
- * <p>
- * The actionlistener of the JSF component
- * </p>
- *
* @return Returns the actionListener.
*/
public String getActionListener()
@@ -135,16 +121,14 @@
return actionListener;
}
- /**
- * <p>
- * The height in pixels of a cell in the compact month view
- * </p>
- *
- * @param compactMonthRowHeight The compactMonthRowHeight to set.
- */
- public void setCompactMonthRowHeight(String compactMonthRowHeight)
+ public String getBackgroundClass()
{
- this.compactMonthRowHeight = compactMonthRowHeight;
+ return backgroundClass;
+ }
+
+ public String getColumnClass()
+ {
+ return columnClass;
}
/**
@@ -164,23 +148,34 @@
* The height in pixels of a cell in the compact week view
* </p>
*
- * @param compactWeekRowHeight The compactWeekRowHeight to set.
+ * @return Returns the compactWeekRowHeight.
*/
- public void setCompactWeekRowHeight(String compactWeekRowHeight)
+ public String getCompactWeekRowHeight()
{
- this.compactWeekRowHeight = compactWeekRowHeight;
+ return compactWeekRowHeight;
}
/**
- * <p>
- * The height in pixels of a cell in the compact week view
- * </p>
- *
- * @return Returns the compactWeekRowHeight.
+ * @see javax.faces.webapp.UIComponentTag#getComponentType()
*/
- public String getCompactWeekRowHeight()
+ public String getComponentType()
{
- return compactWeekRowHeight;
+ return HtmlSchedule.COMPONENT_TYPE;
+ }
+
+ public String getContentClass()
+ {
+ return contentClass;
+ }
+
+ public String getDateClass()
+ {
+ return dateClass;
+ }
+
+ public String getDayClass()
+ {
+ return dayClass;
}
/**
@@ -193,34 +188,39 @@
return detailedRowHeight;
}
- /**
- * The height in pixels of a cell in the detailed day view
- *
- * @param detailedRowHeight the detailedRowHeight
- */
- public void setDetailedRowHeight(String detailedRowHeight)
+ public String getEntryClass()
{
- this.detailedRowHeight = detailedRowHeight;
+ return entryClass;
}
-
- /**
- * @see javax.faces.webapp.UIComponentTag#getComponentType()
- */
- public String getComponentType()
+
+ public String getEntryRenderer()
{
- return HtmlSchedule.COMPONENT_TYPE;
+ return entryRenderer;
}
- /**
- * <p>
- * The dateformat used in the header
- * </p>
- *
- * @param headerDateFormat The headerDateFormat to set.
- */
- public void setHeaderDateFormat(String headerDateFormat)
+ public String getEvenClass()
{
- this.headerDateFormat = headerDateFormat;
+ return evenClass;
+ }
+
+ public String getForegroundClass()
+ {
+ return foregroundClass;
+ }
+
+ public String getFreeClass()
+ {
+ return freeClass;
+ }
+
+ public String getGutterClass()
+ {
+ return gutterClass;
+ }
+
+ public String getHeaderClass()
+ {
+ return headerClass;
}
/**
@@ -235,16 +235,14 @@
return headerDateFormat;
}
- /**
- * <p>
- * The immediate property of the JSF component
- * </p>
- *
- * @param immediate The immediate to set.
- */
- public void setImmediate(String immediate)
+ public String getHolidayClass()
{
- this.immediate = immediate;
+ return holidayClass;
+ }
+
+ public String getHoursClass()
+ {
+ return hoursClass;
}
/**
@@ -259,16 +257,24 @@
return immediate;
}
- /**
- * <p>
- * The readonly property of the JSF component
- * </p>
- *
- * @param readonly The readonly to set.
- */
- public void setReadonly(String readonly)
+ public String getInactiveDayClass()
{
- this.readonly = readonly;
+ return inactiveDayClass;
+ }
+
+ public String getMinutesClass()
+ {
+ return minutesClass;
+ }
+
+ public String getMonthClass()
+ {
+ return monthClass;
+ }
+
+ public String getMouseListener()
+ {
+ return mouseListener;
}
/**
@@ -288,18 +294,6 @@
* Should this component be rendered?
* </p>
*
- * @param rendered The rendered to set.
- */
- public void setRendered(String rendered)
- {
- this.rendered = rendered;
- }
-
- /**
- * <p>
- * Should this component be rendered?
- * </p>
- *
* @return Returns the rendered.
*/
public String getRendered()
@@ -315,18 +309,14 @@
return UISchedule.DEFAULT_RENDERER_TYPE;
}
- /**
- * <p>
- * Should the parent form of this schedule be submitted when the user
- * clicks on a day? Note that this will only work when the readonly
- * property is set to false.
- * </p>
- *
- * @param submitOnClick submit the form on mouse click
- */
- public void setSubmitOnClick(String submitOnClick)
+ public String getSelectedClass()
{
- this.submitOnClick = submitOnClick;
+ return selectedClass;
+ }
+
+ public String getSelectedEntryClass()
+ {
+ return selectedEntryClass;
}
/**
@@ -343,18 +333,14 @@
return submitOnClick;
}
- /**
- * <p>
- * The theme of the schedule component. This is the name of the
- * CSS file that should be loaded when rendering the schedule.
- * Possible values are 'default', 'outlookxp', 'evolution'.
- * </p>
- *
- * @param theme The theme to set.
- */
- public void setTheme(String theme)
+ public String getSubtitleClass()
{
- this.theme = theme;
+ return subtitleClass;
+ }
+
+ public String getTextClass()
+ {
+ return textClass;
}
/**
@@ -371,16 +357,9 @@
return theme;
}
- /**
- * <p>
- * Should tooltips be displayed?
- * </p>
- *
- * @param tooltip The tooltip to set.
- */
- public void setTooltip(String tooltip)
+ public String getTitleClass()
{
- this.tooltip = tooltip;
+ return titleClass;
}
/**
@@ -395,16 +374,9 @@
return tooltip;
}
- /**
- * <p>
- * The value of the JSF component
- * </p>
- *
- * @param value The value to set.
- */
- public void setValue(String value)
+ public String getUnevenClass()
{
- this.value = value;
+ return unevenClass;
}
/**
@@ -424,18 +396,6 @@
* The visible end hour of the schedule
* </p>
*
- * @param visibleEndHour The visibleEndHour to set.
- */
- public void setVisibleEndHour(String visibleEndHour)
- {
- this.visibleEndHour = visibleEndHour;
- }
-
- /**
- * <p>
- * The visible end hour of the schedule
- * </p>
- *
* @return Returns the visibleEndHour.
*/
public String getVisibleEndHour()
@@ -448,18 +408,6 @@
* The visible start hour of the schedule
* </p>
*
- * @param visibleStartHour The visibleStartHour to set.
- */
- public void setVisibleStartHour(String visibleStartHour)
- {
- this.visibleStartHour = visibleStartHour;
- }
-
- /**
- * <p>
- * The visible start hour of the schedule
- * </p>
- *
* @return Returns the visibleStartHour.
*/
public String getVisibleStartHour()
@@ -467,16 +415,9 @@
return visibleStartHour;
}
- /**
- * <p>
- * The working end hour of the schedule
- * </p>
- *
- * @param workingEndHour The workingEndHour to set.
- */
- public void setWorkingEndHour(String workingEndHour)
+ public String getWeekClass()
{
- this.workingEndHour = workingEndHour;
+ return weekClass;
}
/**
@@ -496,28 +437,88 @@
* The working start hour of the schedule
* </p>
*
- * @param workingStartHour The workingStartHour to set.
+ * @return Returns the workingStartHour.
*/
- public void setWorkingStartHour(String workingStartHour)
+ public String getWorkingStartHour()
{
- this.workingStartHour = workingStartHour;
+ return workingStartHour;
+ }
+
+ /**
+ * @see javax.servlet.jsp.tagext.Tag#release()
+ */
+ public void release()
+ {
+ super.release();
+ visibleStartHour = null;
+ visibleEndHour = null;
+ workingStartHour = null;
+ workingEndHour = null;
+ headerDateFormat = null;
+ value = null;
+ immediate = null;
+ actionListener = null;
+ action = null;
+ readonly = null;
+ submitOnClick = null;
+ mouseListener = null;
+ theme = null;
+ tooltip = null;
+ rendered = null;
+ compactMonthRowHeight = null;
+ compactWeekRowHeight = null;
+ detailedRowHeight = null;
+
+ columnClass = null;
+ backgroundClass = null;
+ freeClass = null;
+ evenClass = null;
+ unevenClass = null;
+ gutterClass = null;
+ headerClass = null;
+ dateClass = null;
+ holidayClass = null;
+ hoursClass = null;
+ minutesClass = null;
+ selectedEntryClass = null;
+ textClass = null;
+ titleClass = null;
+ subtitleClass = null;
+ entryClass = null;
+ foregroundClass = null;
+
+ dayClass = null;
+ inactiveDayClass = null;
+ contentClass = null;
+ selectedClass = null;
+ monthClass = null;
+ weekClass = null;
+
+ entryRenderer = null;
}
/**
* <p>
- * The working start hour of the schedule
+ * The action of the JSF component
* </p>
*
- * @return Returns the workingStartHour.
+ * @param action The action to set.
*/
- public String getWorkingStartHour()
+ public void setAction(String action)
{
- return workingStartHour;
+ this.action = action;
}
- public String getBackgroundClass()
+ /**
+ * <p>
+ * The actionlistener of the JSF component
+ * </p>
+ *
+ * @param actionListener The actionListener to set.
+ */
+ public void setActionListener(String actionListener)
{
- return backgroundClass;
+ this.actionListener = actionListener;
}
public void setBackgroundClass(String backgroundClass)
@@ -525,29 +526,38 @@
this.backgroundClass = backgroundClass;
}
- public String getColumnClass()
- {
- return columnClass;
- }
-
public void setColumnClass(String columnClass)
{
this.columnClass = columnClass;
}
- public String getContentClass()
+ /**
+ * <p>
+ * The height in pixels of a cell in the compact month view
+ * </p>
+ *
+ * @param compactMonthRowHeight The compactMonthRowHeight to set.
+ */
+ public void setCompactMonthRowHeight(String compactMonthRowHeight)
{
- return contentClass;
+ this.compactMonthRowHeight = compactMonthRowHeight;
}
- public void setContentClass(String contentClass)
+ /**
+ * <p>
+ * The height in pixels of a cell in the compact week view
+ * </p>
+ *
+ * @param compactWeekRowHeight The compactWeekRowHeight to set.
+ */
+ public void setCompactWeekRowHeight(String compactWeekRowHeight)
{
- this.contentClass = contentClass;
+ this.compactWeekRowHeight = compactWeekRowHeight;
}
- public String getDateClass()
+ public void setContentClass(String contentClass)
{
- return dateClass;
+ this.contentClass = contentClass;
}
public void setDateClass(String dateClass)
@@ -555,19 +565,19 @@
this.dateClass = dateClass;
}
- public String getDayClass()
- {
- return dayClass;
- }
-
public void setDayClass(String dayClass)
{
this.dayClass = dayClass;
}
- public String getEntryClass()
+ /**
+ * The height in pixels of a cell in the detailed day view
+ *
+ * @param detailedRowHeight the detailedRowHeight
+ */
+ public void setDetailedRowHeight(String detailedRowHeight)
{
- return entryClass;
+ this.detailedRowHeight = detailedRowHeight;
}
public void setEntryClass(String entryClass)
@@ -575,9 +585,9 @@
this.entryClass = entryClass;
}
- public String getEvenClass()
+ public void setEntryRenderer(String entryRenderer)
{
- return evenClass;
+ this.entryRenderer = entryRenderer;
}
public void setEvenClass(String evenClass)
@@ -585,237 +595,78 @@
this.evenClass = evenClass;
}
- public String getForegroundClass()
- {
- return foregroundClass;
- }
-
public void setForegroundClass(String foregroundClass)
{
this.foregroundClass = foregroundClass;
}
- public String getFreeClass()
- {
- return freeClass;
- }
-
public void setFreeClass(String freeClass)
{
this.freeClass = freeClass;
}
- public String getGutterClass()
- {
- return gutterClass;
- }
-
public void setGutterClass(String gutterClass)
{
this.gutterClass = gutterClass;
}
- public String getHeaderClass()
- {
- return headerClass;
- }
-
public void setHeaderClass(String headerClass)
{
this.headerClass = headerClass;
}
- public String getHolidayClass()
- {
- return holidayClass;
- }
-
- public void setHolidayClass(String holidayClass)
- {
- this.holidayClass = holidayClass;
- }
-
- public String getHoursClass()
- {
- return hoursClass;
- }
-
- public void setHoursClass(String hoursClass)
- {
- this.hoursClass = hoursClass;
- }
-
- public String getInactiveDayClass()
- {
- return inactiveDayClass;
- }
-
- public void setInactiveDayClass(String inactiveDayClass)
- {
- this.inactiveDayClass = inactiveDayClass;
- }
-
- public String getMinutesClass()
- {
- return minutesClass;
- }
-
- public void setMinutesClass(String minutesClass)
- {
- this.minutesClass = minutesClass;
- }
-
- public String getMonthClass()
- {
- return monthClass;
- }
-
- public void setMonthClass(String monthClass)
- {
- this.monthClass = monthClass;
- }
-
- public String getMouseListener()
- {
- return mouseListener;
- }
-
- public void setMouseListener(String mouseListener)
- {
- this.mouseListener = mouseListener;
- }
-
- public String getSelectedClass()
- {
- return selectedClass;
- }
-
- public void setSelectedClass(String selectedClass)
- {
- this.selectedClass = selectedClass;
- }
-
- public String getSelectedEntryClass()
- {
- return selectedEntryClass;
- }
-
- public void setSelectedEntryClass(String selectedEntryClass)
- {
- this.selectedEntryClass = selectedEntryClass;
- }
-
- public String getSubtitleClass()
- {
- return subtitleClass;
- }
-
- public void setSubtitleClass(String subtitleClass)
- {
- this.subtitleClass = subtitleClass;
- }
-
- public String getTextClass()
- {
- return textClass;
- }
-
- public void setTextClass(String textClass)
- {
- this.textClass = textClass;
- }
-
- public String getTitleClass()
- {
- return titleClass;
- }
-
- public void setTitleClass(String titleClass)
+ /**
+ * <p>
+ * The dateformat used in the header
+ * </p>
+ *
+ * @param headerDateFormat The headerDateFormat to set.
+ */
+ public void setHeaderDateFormat(String headerDateFormat)
{
- this.titleClass = titleClass;
+ this.headerDateFormat = headerDateFormat;
}
- public String getUnevenClass()
+ public void setHolidayClass(String holidayClass)
{
- return unevenClass;
+ this.holidayClass = holidayClass;
}
- public void setUnevenClass(String unevenClass)
+ public void setHoursClass(String hoursClass)
{
- this.unevenClass = unevenClass;
+ this.hoursClass = hoursClass;
}
- public String getWeekClass()
+ /**
+ * <p>
+ * The immediate property of the JSF component
+ * </p>
+ *
+ * @param immediate The immediate to set.
+ */
+ public void setImmediate(String immediate)
{
- return weekClass;
+ this.immediate = immediate;
}
- public void setWeekClass(String weekClass)
+ public void setInactiveDayClass(String inactiveDayClass)
{
- this.weekClass = weekClass;
+ this.inactiveDayClass = inactiveDayClass;
}
- public String getEntryRenderer()
+ public void setMinutesClass(String minutesClass)
{
- return entryRenderer;
+ this.minutesClass = minutesClass;
}
- public void setEntryRenderer(String entryRenderer)
+ public void setMonthClass(String monthClass)
{
- this.entryRenderer = entryRenderer;
+ this.monthClass = monthClass;
}
- /**
- * @see javax.servlet.jsp.tagext.Tag#release()
- */
- public void release()
+ public void setMouseListener(String mouseListener)
{
- super.release();
- visibleStartHour = null;
- visibleEndHour = null;
- workingStartHour = null;
- workingEndHour = null;
- headerDateFormat = null;
- value = null;
- immediate = null;
- actionListener = null;
- action = null;
- readonly = null;
- submitOnClick = null;
- mouseListener = null;
- theme = null;
- tooltip = null;
- rendered = null;
- compactMonthRowHeight = null;
- compactWeekRowHeight = null;
- detailedRowHeight = null;
-
- columnClass = null;
- backgroundClass = null;
- freeClass = null;
- evenClass = null;
- unevenClass = null;
- gutterClass = null;
- headerClass = null;
- dateClass = null;
- holidayClass = null;
- hoursClass = null;
- minutesClass = null;
- selectedEntryClass = null;
- textClass = null;
- titleClass = null;
- subtitleClass = null;
- entryClass = null;
- foregroundClass = null;
-
- dayClass = null;
- inactiveDayClass = null;
- contentClass = null;
- selectedClass = null;
- monthClass = null;
- weekClass = null;
-
- entryRenderer = null;
+ this.mouseListener = mouseListener;
}
/**
@@ -924,7 +775,7 @@
schedule.setReadonly(Boolean.valueOf(readonly).booleanValue());
}
}
-
+
if (submitOnClick != null)
{
if (isValueReference(submitOnClick))
@@ -938,13 +789,14 @@
.booleanValue());
}
}
-
+
if (mouseListener != null)
{
if (isValueReference(mouseListener))
{
- MethodBinding mouseListenerBinding = app.createMethodBinding(
- mouseListener, new Class[] { ScheduleMouseEvent.class });
+ MethodBinding mouseListenerBinding = app
+ .createMethodBinding(mouseListener,
+ new Class[] { ScheduleMouseEvent.class });
schedule.setMouseListener(mouseListenerBinding);
}
else
@@ -973,7 +825,8 @@
{
if (isValueReference(action))
{
- MethodBinding actionBinding = app.createMethodBinding(action, null);
+ MethodBinding actionBinding = app.createMethodBinding(action,
+ null);
schedule.setAction(actionBinding);
}
else
@@ -1000,8 +853,7 @@
compactWeekRowHeight);
addAttribute(app, schedule, "compactMonthRowHeight",
compactMonthRowHeight);
- addAttribute(app, schedule, "detailedRowHeight",
- detailedRowHeight);
+ addAttribute(app, schedule, "detailedRowHeight", detailedRowHeight);
addAttribute(app, schedule, "column", columnClass);
addAttribute(app, schedule, "background", backgroundClass);
addAttribute(app, schedule, "free", freeClass);
@@ -1019,32 +871,174 @@
addAttribute(app, schedule, "subtitle", subtitleClass);
addAttribute(app, schedule, "entry", entryClass);
addAttribute(app, schedule, "foreground", foregroundClass);
-
+
addAttribute(app, schedule, "day", dayClass);
addAttribute(app, schedule, "inactive-day", inactiveDayClass);
addAttribute(app, schedule, "content", contentClass);
addAttribute(app, schedule, "selected", selectedClass);
addAttribute(app, schedule, "month", monthClass);
addAttribute(app, schedule, "week", weekClass);
-
+
addAttribute(app, schedule, "entryRenderer", entryRenderer);
}
- private void addAttribute(Application app, UIComponent component,
- String key, String value)
+ /**
+ * <p>
+ * The readonly property of the JSF component
+ * </p>
+ *
+ * @param readonly The readonly to set.
+ */
+ public void setReadonly(String readonly)
{
- if ((key != null) && (value != null))
- {
- if (isValueReference(value))
- {
- component.setValueBinding(key, app
- .createValueBinding((String) value));
- }
- else
- {
- component.getAttributes().put(key, value);
- }
- }
+ this.readonly = readonly;
+ }
+
+ /**
+ * <p>
+ * Should this component be rendered?
+ * </p>
+ *
+ * @param rendered The rendered to set.
+ */
+ public void setRendered(String rendered)
+ {
+ this.rendered = rendered;
+ }
+
+ public void setSelectedClass(String selectedClass)
+ {
+ this.selectedClass = selectedClass;
+ }
+
+ public void setSelectedEntryClass(String selectedEntryClass)
+ {
+ this.selectedEntryClass = selectedEntryClass;
+ }
+
+ /**
+ * <p>
+ * Should the parent form of this schedule be submitted when the user
+ * clicks on a day? Note that this will only work when the readonly
+ * property is set to false.
+ * </p>
+ *
+ * @param submitOnClick submit the form on mouse click
+ */
+ public void setSubmitOnClick(String submitOnClick)
+ {
+ this.submitOnClick = submitOnClick;
+ }
+
+ public void setSubtitleClass(String subtitleClass)
+ {
+ this.subtitleClass = subtitleClass;
+ }
+
+ public void setTextClass(String textClass)
+ {
+ this.textClass = textClass;
+ }
+
+ /**
+ * <p>
+ * The theme of the schedule component. This is the name of the
+ * CSS file that should be loaded when rendering the schedule.
+ * Possible values are 'default', 'outlookxp', 'evolution'.
+ * </p>
+ *
+ * @param theme The theme to set.
+ */
+ public void setTheme(String theme)
+ {
+ this.theme = theme;
+ }
+
+ public void setTitleClass(String titleClass)
+ {
+ this.titleClass = titleClass;
+ }
+
+ /**
+ * <p>
+ * Should tooltips be displayed?
+ * </p>
+ *
+ * @param tooltip The tooltip to set.
+ */
+ public void setTooltip(String tooltip)
+ {
+ this.tooltip = tooltip;
+ }
+
+ public void setUnevenClass(String unevenClass)
+ {
+ this.unevenClass = unevenClass;
+ }
+
+ /**
+ * <p>
+ * The value of the JSF component
+ * </p>
+ *
+ * @param value The value to set.
+ */
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+ /**
+ * <p>
+ * The visible end hour of the schedule
+ * </p>
+ *
+ * @param visibleEndHour The visibleEndHour to set.
+ */
+ public void setVisibleEndHour(String visibleEndHour)
+ {
+ this.visibleEndHour = visibleEndHour;
+ }
+
+ /**
+ * <p>
+ * The visible start hour of the schedule
+ * </p>
+ *
+ * @param visibleStartHour The visibleStartHour to set.
+ */
+ public void setVisibleStartHour(String visibleStartHour)
+ {
+ this.visibleStartHour = visibleStartHour;
+ }
+
+ public void setWeekClass(String weekClass)
+ {
+ this.weekClass = weekClass;
+ }
+
+ /**
+ * <p>
+ * The working end hour of the schedule
+ * </p>
+ *
+ * @param workingEndHour The workingEndHour to set.
+ */
+ public void setWorkingEndHour(String workingEndHour)
+ {
+ this.workingEndHour = workingEndHour;
+ }
+
+ /**
+ * <p>
+ * The working start hour of the schedule
+ * </p>
+ *
+ * @param workingStartHour The workingStartHour to set.
+ */
+ public void setWorkingStartHour(String workingStartHour)
+ {
+ this.workingStartHour = workingStartHour;
}
}
//The End
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UIPlanner.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UIPlanner.java?rev=392301&r1=392300&r2=392301&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UIPlanner.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UIPlanner.java Fri Apr 7 07:23:48 2006
@@ -16,9 +16,7 @@
package org.apache.myfaces.custom.schedule;
-
import java.io.Serializable;
-
import java.util.Iterator;
import javax.faces.component.UIComponentBase;
@@ -31,7 +29,6 @@
import org.apache.myfaces.custom.schedule.model.ScheduleEntry;
import org.apache.myfaces.custom.schedule.util.ScheduleUtil;
-
/**
* <p>
* A meeting planner component, similar to the ones found in Outlook or
@@ -42,27 +39,25 @@
* @author Bruno Aranda (adaptation of Jurgen's code to myfaces)
* @version $Revision$
*/
-public class UIPlanner
- extends UIComponentBase
- implements ValueHolder, Serializable
+public class UIPlanner extends UIComponentBase implements ValueHolder,
+ Serializable
{
//~ Static fields/initializers ---------------------------------------------
- /** Logger for this class */
- public static final String COMPONENT_TYPE =
- "org.apache.myfaces.Planner";
public static final String COMPONENT_FAMILY = "javax.faces.Panel";
- public static final String DEFAULT_RENDERER_TYPE =
- "org.apache.myfaces.Planner";
+ /** Logger for this class */
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.Planner";
+ public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Planner";
+ private static final long serialVersionUID = 4396986521172225477L;
//~ Instance fields --------------------------------------------------------
private Converter _converter;
+ private Object _value;
private Integer _visibleEndHour;
private Integer _visibleStartHour;
private Integer _workingEndHour;
private Integer _workingStartHour;
- private Object _value;
//~ Constructors -----------------------------------------------------------
@@ -78,11 +73,38 @@
//~ Methods ----------------------------------------------------------------
/**
- * @see javax.faces.component.ValueHolder#setConverter(javax.faces.convert.Converter)
+ * <p>
+ * Find the entry with the given id
+ * </p>
+ *
+ * @param id the id
+ *
+ * @return the entry
*/
- public void setConverter(Converter converter)
+ public ScheduleEntry findEntry(String id)
{
- this._converter = converter;
+ if (id == null)
+ {
+ return null;
+ }
+
+ for (Iterator entityIterator = getModel().entityIterator(); entityIterator
+ .hasNext();)
+ {
+ PlannerEntity entity = (PlannerEntity) entityIterator.next();
+
+ for (Iterator iter = entity.iterator(); iter.hasNext();)
+ {
+ ScheduleEntry entry = (ScheduleEntry) iter.next();
+
+ if (id.equals(entry.getId()))
+ {
+ return entry;
+ }
+ }
+ }
+
+ return null;
}
/**
@@ -114,25 +136,16 @@
* The underlying planner model
* </p>
*
- * @param model the model
- */
- public void setModel(PlannerModel model)
- {
- setValue(model);
- }
-
- /**
- * <p>
- * The underlying planner model
- * </p>
- *
* @return the model
*/
public PlannerModel getModel()
{
- if (getValue() instanceof PlannerModel) {
+ if (getValue() instanceof PlannerModel)
+ {
return (PlannerModel) getValue();
- } else {
+ }
+ else
+ {
return new PlannerModel();
}
}
@@ -146,14 +159,6 @@
}
/**
- * @see javax.faces.component.ValueHolder#setValue(java.lang.Object)
- */
- public void setValue(Object value)
- {
- this._value = value;
- }
-
- /**
* @see javax.faces.component.ValueHolder#getValue()
*/
public Object getValue()
@@ -163,173 +168,161 @@
/**
* <p>
- * the last hour of the day that is visible in the planner
+ * The last hour of the day that is visible in the planner
* </p>
*
- * @param visibleEndHour The visibleEndHour to set.
+ * @return Returns the visibleEndHour.
*/
- public void setVisibleEndHour(int visibleEndHour)
+ public int getVisibleEndHour()
{
- this._visibleEndHour = new Integer(visibleEndHour);
+ return ScheduleUtil.getIntegerProperty(this, _visibleEndHour,
+ "visibleEndHour", 22);
}
/**
* <p>
- * The last hour of the day that is visible in the planner
+ * the first hour of the day that is visible in the planner
* </p>
*
- * @return Returns the visibleEndHour.
+ * @return Returns the visibleStartHour.
*/
- public int getVisibleEndHour()
+ public int getVisibleStartHour()
{
- return ScheduleUtil.getIntegerProperty(
- this, _visibleEndHour, "visibleEndHour", 22
- );
+ return ScheduleUtil.getIntegerProperty(this, _visibleStartHour,
+ "visibleStartHour", 8);
}
/**
* <p>
- * the first hour of the day that is visible in the planner
+ * the last hour of the working day
* </p>
*
- * @param visibleStartHour The visibleStartHour to set.
+ * @return Returns the workingEndHour.
*/
- public void setVisibleStartHour(int visibleStartHour)
+ public int getWorkingEndHour()
{
- this._visibleStartHour = new Integer(visibleStartHour);
+ return ScheduleUtil.getIntegerProperty(this, _workingEndHour,
+ "workingEndHour", 17);
}
/**
* <p>
- * the first hour of the day that is visible in the planner
+ * The first hour of the working day
* </p>
*
- * @return Returns the visibleStartHour.
+ * @return Returns the workingStartHour.
*/
- public int getVisibleStartHour()
+ public int getWorkingStartHour()
{
- return ScheduleUtil.getIntegerProperty(
- this, _visibleStartHour, "visibleStartHour", 8
- );
+ return ScheduleUtil.getIntegerProperty(this, _workingStartHour,
+ "workingStartHour", 9);
}
/**
- * <p>
- * the last hour of the working day
- * </p>
- *
- * @param workingEndHour The workingEndHour to set.
+ * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext,
+ * java.lang.Object)
*/
- public void setWorkingEndHour(int workingEndHour)
+ public void restoreState(FacesContext context, Object state)
{
- this._workingEndHour = new Integer(workingEndHour);
+ Object[] values = (Object[]) state;
+ super.restoreState(context, values[0]);
+ _visibleStartHour = (Integer) values[1];
+ _visibleEndHour = (Integer) values[2];
+ _workingStartHour = (Integer) values[3];
+ _workingEndHour = (Integer) values[4];
+ _value = values[5];
}
/**
- * <p>
- * the last hour of the working day
- * </p>
- *
- * @return Returns the workingEndHour.
+ * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
*/
- public int getWorkingEndHour()
+ public Object saveState(FacesContext context)
{
- return ScheduleUtil.getIntegerProperty(
- this, _workingEndHour, "workingEndHour", 17
- );
+ Object[] values = new Object[6];
+ values[0] = super.saveState(context);
+ values[1] = _visibleStartHour;
+ values[2] = _visibleEndHour;
+ values[3] = _workingStartHour;
+ values[4] = _workingEndHour;
+ values[5] = _value;
+
+ return values;
+ }
+
+ /**
+ * @see javax.faces.component.ValueHolder#setConverter(javax.faces.convert.Converter)
+ */
+ public void setConverter(Converter converter)
+ {
+ this._converter = converter;
}
/**
* <p>
- * The first hour of the working day
+ * The underlying planner model
* </p>
*
- * @param workingStartHour The workingStartHour to set.
+ * @param model the model
*/
- public void setWorkingStartHour(int workingStartHour)
+ public void setModel(PlannerModel model)
{
- this._workingStartHour = new Integer(workingStartHour);
+ setValue(model);
+ }
+
+ /**
+ * @see javax.faces.component.ValueHolder#setValue(java.lang.Object)
+ */
+ public void setValue(Object value)
+ {
+ this._value = value;
}
/**
* <p>
- * The first hour of the working day
+ * the last hour of the day that is visible in the planner
* </p>
*
- * @return Returns the workingStartHour.
+ * @param visibleEndHour The visibleEndHour to set.
*/
- public int getWorkingStartHour()
+ public void setVisibleEndHour(int visibleEndHour)
{
- return ScheduleUtil.getIntegerProperty(
- this, _workingStartHour, "workingStartHour", 9
- );
+ this._visibleEndHour = new Integer(visibleEndHour);
}
/**
* <p>
- * Find the entry with the given id
+ * the first hour of the day that is visible in the planner
* </p>
*
- * @param id the id
- *
- * @return the entry
+ * @param visibleStartHour The visibleStartHour to set.
*/
- public ScheduleEntry findEntry(String id)
+ public void setVisibleStartHour(int visibleStartHour)
{
- if (id == null) {
- return null;
- }
-
- for (
- Iterator entityIterator = getModel().entityIterator();
- entityIterator.hasNext();
- ) {
- PlannerEntity entity = (PlannerEntity) entityIterator.next();
-
- for (Iterator iter = entity.iterator(); iter.hasNext();) {
- ScheduleEntry entry = (ScheduleEntry) iter.next();
-
- if (id.equals(entry.getId())) {
- return entry;
- }
- }
- }
-
- return null;
+ this._visibleStartHour = new Integer(visibleStartHour);
}
/**
- * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext,
- * java.lang.Object)
+ * <p>
+ * the last hour of the working day
+ * </p>
+ *
+ * @param workingEndHour The workingEndHour to set.
*/
- public void restoreState(
- FacesContext context,
- Object state
- )
+ public void setWorkingEndHour(int workingEndHour)
{
- Object[] values = (Object[]) state;
- super.restoreState(context, values[0]);
- _visibleStartHour = (Integer) values[1];
- _visibleEndHour = (Integer) values[2];
- _workingStartHour = (Integer) values[3];
- _workingEndHour = (Integer) values[4];
- _value = values[5];
+ this._workingEndHour = new Integer(workingEndHour);
}
/**
- * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
+ * <p>
+ * The first hour of the working day
+ * </p>
+ *
+ * @param workingStartHour The workingStartHour to set.
*/
- public Object saveState(FacesContext context)
+ public void setWorkingStartHour(int workingStartHour)
{
- Object[] values = new Object[6];
- values[0] = super.saveState(context);
- values[1] = _visibleStartHour;
- values[2] = _visibleEndHour;
- values[3] = _workingStartHour;
- values[4] = _workingEndHour;
- values[5] = _value;
-
- return values;
+ this._workingStartHour = new Integer(workingStartHour);
}
}
//The End
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UISchedule.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UISchedule.java?rev=392301&r1=392300&r2=392301&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UISchedule.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/UISchedule.java Fri Apr 7 07:23:48 2006
@@ -16,9 +16,7 @@
package org.apache.myfaces.custom.schedule;
-
import java.io.Serializable;
-
import java.util.Iterator;
import javax.faces.component.ActionSource;
@@ -33,15 +31,12 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.custom.schedule.model.ScheduleDay;
import org.apache.myfaces.custom.schedule.model.ScheduleEntry;
import org.apache.myfaces.custom.schedule.model.ScheduleModel;
import org.apache.myfaces.custom.schedule.model.SimpleScheduleModel;
import org.apache.myfaces.custom.schedule.util.ScheduleUtil;
-
/**
* <p>
* A schedule component similar to the ones found in Outlook or Evolution
@@ -51,34 +46,58 @@
* @author Bruno Aranda (adaptation of Jurgen code to myfaces)
* @version $Revision$
*/
-public class UISchedule
- extends UIComponentBase
- implements ValueHolder, Serializable, ActionSource
+public class UISchedule extends UIComponentBase implements ValueHolder,
+ Serializable, ActionSource
{
- //~ Static fields/initializers ---------------------------------------------
- public static final String COMPONENT_TYPE =
- "org.apache.myfaces.Schedule";
+ private static final long serialVersionUID = 3440822180568539483L;
+
+ private class ScheduleActionListener implements ActionListener
+ {
+ //~ Methods ------------------------------------------------------------
+
+ /**
+ * @see javax.faces.event.ActionListener#processAction(javax.faces.event.ActionEvent)
+ */
+ public void processAction(ActionEvent event)
+ throws AbortProcessingException
+ {
+ UISchedule schedule = (UISchedule) event.getComponent();
+ ScheduleEntry entry = schedule.getSubmittedEntry();
+ schedule.getModel().setSelectedEntry(entry);
+ schedule.setSubmittedEntry(null);
+
+ if (schedule.getAction() != null)
+ {
+ getFacesContext().getApplication().getActionListener()
+ .processAction(event);
+ }
+ }
+ }
public static final String COMPONENT_FAMILY = "javax.faces.Panel";
- public static final String DEFAULT_RENDERER_TYPE =
- "org.apache.myfaces.Schedule";
+ //~ Static fields/initializers ---------------------------------------------
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.Schedule";
//~ Instance fields --------------------------------------------------------
+ public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Schedule";
+ private MethodBinding actionBinding;
+ private MethodBinding actionListenerBinding;
+ private Converter converter;
private Boolean immediate;
private Boolean readonly;
- private Converter converter;
+ private ScheduleActionListener scheduleListener;
+ private ScheduleEntry submittedEntry;
+ private Object value;
private Integer visibleEndHour;
private Integer visibleStartHour;
private Integer workingEndHour;
- private Integer workingStartHour;
- private MethodBinding actionBinding;
- private MethodBinding actionListenerBinding;
- private Object value;
- private ScheduleActionListener scheduleListener;
- private ScheduleEntry submittedEntry;
//~ Constructors -----------------------------------------------------------
+ private Integer workingStartHour;
+
+ //~ Methods ----------------------------------------------------------------
+
/**
* Creates a new UISchedule object.
*/
@@ -90,30 +109,71 @@
addActionListener(scheduleListener);
}
- //~ Methods ----------------------------------------------------------------
+ /**
+ * @see javax.faces.component.ActionSource#addActionListener(javax.faces.event.ActionListener)
+ */
+ public void addActionListener(ActionListener listener)
+ {
+ addFacesListener(listener);
+ }
/**
- * @see javax.faces.component.ActionSource#setAction(javax.faces.el.MethodBinding)
+ * @see javax.faces.component.UIComponent#broadcast(javax.faces.event.FacesEvent)
*/
- public void setAction(MethodBinding action)
+ public void broadcast(FacesEvent event) throws AbortProcessingException
{
- this.actionBinding = action;
+ super.broadcast(event);
+
+ FacesContext context = getFacesContext();
+ MethodBinding actionListenerBinding = getActionListener();
+
+ if (actionListenerBinding != null)
+ {
+ actionListenerBinding.invoke(context, new Object[] { event });
+ }
}
/**
- * @see javax.faces.component.ActionSource#getAction()
+ * <p>
+ * Find the entry with the given id
+ * </p>
+ *
+ * @param id the id
+ *
+ * @return the entry
*/
- public MethodBinding getAction()
+ public ScheduleEntry findEntry(String id)
{
- return actionBinding;
+ if (id == null)
+ {
+ return null;
+ }
+
+ for (Iterator dayIterator = getModel().iterator(); dayIterator
+ .hasNext();)
+ {
+ ScheduleDay day = (ScheduleDay) dayIterator.next();
+
+ for (Iterator iter = day.iterator(); iter.hasNext();)
+ {
+ ScheduleEntry entry = (ScheduleEntry) iter.next();
+
+ if (id.equals(entry.getId()))
+ {
+ return entry;
+ }
+ }
+ }
+
+ return null;
}
/**
- * @see javax.faces.component.ActionSource#setActionListener(javax.faces.el.MethodBinding)
+ * @see javax.faces.component.ActionSource#getAction()
*/
- public void setActionListener(MethodBinding listener)
+ public MethodBinding getAction()
{
- this.actionListenerBinding = listener;
+ return actionBinding;
}
/**
@@ -133,14 +193,6 @@
}
/**
- * @see javax.faces.component.ValueHolder#setConverter(javax.faces.convert.Converter)
- */
- public void setConverter(Converter converter)
- {
- this.converter = converter;
- }
-
- /**
* @see javax.faces.component.ValueHolder#getConverter()
*/
public Converter getConverter()
@@ -157,22 +209,6 @@
}
/**
- * @see javax.faces.component.ActionSource#setImmediate(boolean)
- */
- public void setImmediate(boolean immediate)
- {
- this.immediate = Boolean.valueOf(immediate);
- }
-
- /**
- * @see javax.faces.component.ActionSource#isImmediate()
- */
- public boolean isImmediate()
- {
- return ScheduleUtil.getBooleanProperty(this, immediate, "immediate", false);
- }
-
- /**
* @see javax.faces.component.ValueHolder#getLocalValue()
*/
public Object getLocalValue()
@@ -185,54 +221,21 @@
* The underlying model
* </p>
*
- * @param model The model to set.
- */
- public void setModel(ScheduleModel model)
- {
- setValue(model);
- }
-
- /**
- * <p>
- * The underlying model
- * </p>
- *
* @return Returns the model.
*/
public ScheduleModel getModel()
{
- if (getValue() instanceof ScheduleModel) {
+ if (getValue() instanceof ScheduleModel)
+ {
return (ScheduleModel) getValue();
- } else {
+ }
+ else
+ {
return new SimpleScheduleModel();
}
}
/**
- * <p>
- * is this component read-only?
- * </p>
- *
- * @param readonly is this component read-only
- */
- public void setReadonly(boolean readonly)
- {
- this.readonly = Boolean.valueOf(readonly);
- }
-
- /**
- * <p>
- * is this component read-only?
- * </p>
- *
- * @return is this component read-only
- */
- public boolean isReadonly()
- {
- return ScheduleUtil.getBooleanProperty(this, readonly, "readonly", false);
- }
-
- /**
* @see javax.faces.component.UIComponent#getRendersChildren()
*/
public boolean getRendersChildren()
@@ -245,18 +248,6 @@
* The entry that was submitted on the last request
* </p>
*
- * @param submittedEntry The submittedEntry to set.
- */
- public void setSubmittedEntry(ScheduleEntry submittedEntry)
- {
- this.submittedEntry = submittedEntry;
- }
-
- /**
- * <p>
- * The entry that was submitted on the last request
- * </p>
- *
* @return Returns the submittedEntry.
*/
public ScheduleEntry getSubmittedEntry()
@@ -265,14 +256,6 @@
}
/**
- * @see javax.faces.component.ValueHolder#setValue(java.lang.Object)
- */
- public void setValue(Object value)
- {
- this.value = value;
- }
-
- /**
* @see javax.faces.component.ValueHolder#getValue()
*/
public Object getValue()
@@ -285,37 +268,12 @@
* The last visible hour of the day
* </p>
*
- * @param visibleEndHour The visibleEndHour to set.
- */
- public void setVisibleEndHour(int visibleEndHour)
- {
- this.visibleEndHour = new Integer(visibleEndHour);
- }
-
- /**
- * <p>
- * The last visible hour of the day
- * </p>
- *
* @return Returns the visibleEndHour.
*/
public int getVisibleEndHour()
{
- return ScheduleUtil.getIntegerProperty(
- this, visibleEndHour, "visibleEndHour", 22
- );
- }
-
- /**
- * <p>
- * The first visible hour of the day
- * </p>
- *
- * @param visibleStartHour The visibleStartHour to set.
- */
- public void setVisibleStartHour(int visibleStartHour)
- {
- this.visibleStartHour = new Integer(visibleStartHour);
+ return ScheduleUtil.getIntegerProperty(this, visibleEndHour,
+ "visibleEndHour", 22);
}
/**
@@ -327,21 +285,8 @@
*/
public int getVisibleStartHour()
{
- return ScheduleUtil.getIntegerProperty(
- this, visibleStartHour, "visibleStartHour", 8
- );
- }
-
- /**
- * <p>
- * The last hour of the working day
- * </p>
- *
- * @param workingEndHour The workingEndHour to set.
- */
- public void setWorkingEndHour(int workingEndHour)
- {
- this.workingEndHour = new Integer(workingEndHour);
+ return ScheduleUtil.getIntegerProperty(this, visibleStartHour,
+ "visibleStartHour", 8);
}
/**
@@ -353,21 +298,8 @@
*/
public int getWorkingEndHour()
{
- return ScheduleUtil.getIntegerProperty(
- this, workingEndHour, "workingEndHour", 17
- );
- }
-
- /**
- * <p>
- * The first hour of the working day
- * </p>
- *
- * @param workingStartHour The workingStartHour to set.
- */
- public void setWorkingStartHour(int workingStartHour)
- {
- this.workingStartHour = new Integer(workingStartHour);
+ return ScheduleUtil.getIntegerProperty(this, workingEndHour,
+ "workingEndHour", 17);
}
/**
@@ -379,66 +311,30 @@
*/
public int getWorkingStartHour()
{
- return ScheduleUtil.getIntegerProperty(
- this, workingStartHour, "workingStartHour", 9
- );
- }
-
- /**
- * @see javax.faces.component.ActionSource#addActionListener(javax.faces.event.ActionListener)
- */
- public void addActionListener(ActionListener listener)
- {
- addFacesListener(listener);
+ return ScheduleUtil.getIntegerProperty(this, workingStartHour,
+ "workingStartHour", 9);
}
/**
- * @see javax.faces.component.UIComponent#broadcast(javax.faces.event.FacesEvent)
+ * @see javax.faces.component.ActionSource#isImmediate()
*/
- public void broadcast(FacesEvent event)
- throws AbortProcessingException
+ public boolean isImmediate()
{
- super.broadcast(event);
-
- FacesContext context = getFacesContext();
- MethodBinding actionListenerBinding = getActionListener();
-
- if (actionListenerBinding != null)
- {
- actionListenerBinding.invoke(context, new Object[] { event });
- }
+ return ScheduleUtil.getBooleanProperty(this, immediate, "immediate",
+ false);
}
/**
* <p>
- * Find the entry with the given id
+ * is this component read-only?
* </p>
*
- * @param id the id
- *
- * @return the entry
+ * @return is this component read-only
*/
- public ScheduleEntry findEntry(String id)
+ public boolean isReadonly()
{
- if (id == null) {
- return null;
- }
-
- for (Iterator dayIterator = getModel().iterator();
- dayIterator.hasNext();
- ) {
- ScheduleDay day = (ScheduleDay) dayIterator.next();
-
- for (Iterator iter = day.iterator(); iter.hasNext();) {
- ScheduleEntry entry = (ScheduleEntry) iter.next();
-
- if (id.equals(entry.getId())) {
- return entry;
- }
- }
- }
-
- return null;
+ return ScheduleUtil.getBooleanProperty(this, readonly, "readonly",
+ false);
}
/**
@@ -446,10 +342,14 @@
*/
public void queueEvent(FacesEvent event)
{
- if (event instanceof ActionEvent) {
- if (isImmediate()) {
+ if (event instanceof ActionEvent)
+ {
+ if (isImmediate())
+ {
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else {
+ }
+ else
+ {
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
}
@@ -469,10 +369,7 @@
* @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext,
* java.lang.Object)
*/
- public void restoreState(
- FacesContext context,
- Object state
- )
+ public void restoreState(FacesContext context, Object state)
{
Object[] values = (Object[]) state;
super.restoreState(context, values[0]);
@@ -483,21 +380,22 @@
Boolean immediateState = (Boolean) values[5];
- if (immediateState != null) {
+ if (immediateState != null)
+ {
setImmediate(immediateState.booleanValue());
}
Boolean readonlyState = (Boolean) values[6];
- if (readonlyState != null) {
+ if (readonlyState != null)
+ {
setReadonly(readonlyState.booleanValue());
}
value = values[7];
- actionListenerBinding =
- (MethodBinding) restoreAttachedState(context, values[8]);
- actionBinding =
- (MethodBinding) restoreAttachedState(context, values[9]);
+ actionListenerBinding = (MethodBinding) restoreAttachedState(context,
+ values[8]);
+ actionBinding = (MethodBinding) restoreAttachedState(context, values[9]);
addActionListener(scheduleListener);
}
@@ -523,29 +421,130 @@
return values;
}
- //~ Inner Classes ----------------------------------------------------------
+ /**
+ * @see javax.faces.component.ActionSource#setAction(javax.faces.el.MethodBinding)
+ */
+ public void setAction(MethodBinding action)
+ {
+ this.actionBinding = action;
+ }
- private class ScheduleActionListener
- implements ActionListener
+ /**
+ * @see javax.faces.component.ActionSource#setActionListener(javax.faces.el.MethodBinding)
+ */
+ public void setActionListener(MethodBinding listener)
{
- //~ Methods ------------------------------------------------------------
+ this.actionListenerBinding = listener;
+ }
- /**
- * @see javax.faces.event.ActionListener#processAction(javax.faces.event.ActionEvent)
- */
- public void processAction(ActionEvent event)
- throws AbortProcessingException
- {
- UISchedule schedule = (UISchedule) event.getComponent();
- ScheduleEntry entry = schedule.getSubmittedEntry();
- schedule.getModel().setSelectedEntry(entry);
- schedule.setSubmittedEntry(null);
+ /**
+ * @see javax.faces.component.ValueHolder#setConverter(javax.faces.convert.Converter)
+ */
+ public void setConverter(Converter converter)
+ {
+ this.converter = converter;
+ }
- if (schedule.getAction() != null) {
- getFacesContext().getApplication().getActionListener()
- .processAction(event);
- }
- }
+ /**
+ * @see javax.faces.component.ActionSource#setImmediate(boolean)
+ */
+ public void setImmediate(boolean immediate)
+ {
+ this.immediate = Boolean.valueOf(immediate);
+ }
+
+ /**
+ * <p>
+ * The underlying model
+ * </p>
+ *
+ * @param model The model to set.
+ */
+ public void setModel(ScheduleModel model)
+ {
+ setValue(model);
+ }
+
+ /**
+ * <p>
+ * is this component read-only?
+ * </p>
+ *
+ * @param readonly is this component read-only
+ */
+ public void setReadonly(boolean readonly)
+ {
+ this.readonly = Boolean.valueOf(readonly);
+ }
+
+ /**
+ * <p>
+ * The entry that was submitted on the last request
+ * </p>
+ *
+ * @param submittedEntry The submittedEntry to set.
+ */
+ public void setSubmittedEntry(ScheduleEntry submittedEntry)
+ {
+ this.submittedEntry = submittedEntry;
+ }
+
+ /**
+ * @see javax.faces.component.ValueHolder#setValue(java.lang.Object)
+ */
+ public void setValue(Object value)
+ {
+ this.value = value;
+ }
+
+ /**
+ * <p>
+ * The last visible hour of the day
+ * </p>
+ *
+ * @param visibleEndHour The visibleEndHour to set.
+ */
+ public void setVisibleEndHour(int visibleEndHour)
+ {
+ this.visibleEndHour = new Integer(visibleEndHour);
+ }
+
+ /**
+ * <p>
+ * The first visible hour of the day
+ * </p>
+ *
+ * @param visibleStartHour The visibleStartHour to set.
+ */
+ public void setVisibleStartHour(int visibleStartHour)
+ {
+ this.visibleStartHour = new Integer(visibleStartHour);
+ }
+
+ /**
+ * <p>
+ * The last hour of the working day
+ * </p>
+ *
+ * @param workingEndHour The workingEndHour to set.
+ */
+ public void setWorkingEndHour(int workingEndHour)
+ {
+ this.workingEndHour = new Integer(workingEndHour);
+ }
+
+ //~ Inner Classes ----------------------------------------------------------
+
+ /**
+ * <p>
+ * The first hour of the working day
+ * </p>
+ *
+ * @param workingStartHour The workingStartHour to set.
+ */
+ public void setWorkingStartHour(int workingStartHour)
+ {
+ this.workingStartHour = new Integer(workingStartHour);
}
}
//The End
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java?rev=392301&r1=392300&r2=392301&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java Fri Apr 7 07:23:48 2006
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.myfaces.custom.schedule.renderer;
import java.io.IOException;
@@ -23,6 +39,8 @@
*/
public class DefaultScheduleEntryRenderer implements ScheduleEntryRenderer
{
+ private static final long serialVersionUID = 4987926168243581739L;
+
/**
* @see org.apache.myfaces.custom.schedule.renderer.ScheduleEntryRenderer#renderContent(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleDay, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean, boolean)
*/
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java?rev=392301&r1=392300&r2=392301&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java Fri Apr 7 07:23:48 2006
@@ -21,7 +21,6 @@
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
-import java.util.Map;
import java.util.TreeSet;
import javax.faces.component.UIComponent;