You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/02/07 06:23:26 UTC
svn commit: r619270 -
/myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/schedule/AbstractUIScheduleBase.java
Author: lu4242
Date: Wed Feb 6 21:23:25 2008
New Revision: 619270
URL: http://svn.apache.org/viewvc?rev=619270&view=rev
Log:
Created AbstractUIScheduleBase
Added:
myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/schedule/AbstractUIScheduleBase.java (with props)
Added: myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/schedule/AbstractUIScheduleBase.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/schedule/AbstractUIScheduleBase.java?rev=619270&view=auto
==============================================================================
--- myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/schedule/AbstractUIScheduleBase.java (added)
+++ myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/schedule/AbstractUIScheduleBase.java Wed Feb 6 21:23:25 2008
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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;
+
+import java.io.Serializable;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.ValueHolder;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.custom.schedule.model.ScheduleModel;
+import org.apache.myfaces.custom.schedule.model.SimpleScheduleModel;
+
+/**
+ * Base class for the Schedule component. This class contains all the properties
+ * for the schedule, but not the ActionSource stuff. Keeping these things separate
+ * should make the code a little easier to digest.
+ *
+ * @author Jurgen Lust
+ * @version $Revision$
+ */
+abstract class AbstractUIScheduleBase extends UIComponentBase
+ implements ValueHolder, Serializable
+{
+ private static final long serialVersionUID = 5702081384947086911L;
+
+ protected static final String HOUR_NOTATION_24 = "24";
+ protected static final String HOUR_NOTATION_12 = "12";
+
+ public static final String RENDERER_TYPE = "org.apache.myfaces.Schedule";
+
+ protected static final String DEFAULT_ENABLED_ON_USER_ROLE = null;
+ protected static final String DEFAULT_VISIBLE_ON_USER_ROLE = null;
+
+
+ /**
+ * The underlying model
+ *
+ * @return Returns the model.
+ */
+ public ScheduleModel getModel()
+ {
+ if (getValue() instanceof ScheduleModel)
+ {
+ return (ScheduleModel) getValue();
+ }
+ else
+ {
+ return new SimpleScheduleModel();
+ }
+ }
+
+
+}
Propchange: myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/schedule/AbstractUIScheduleBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/schedule/AbstractUIScheduleBase.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL