You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2006/09/25 18:22:57 UTC

svn commit: r449721 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/component/ theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/ tobago-tool/gendoc/src/main/webapp/screenshot/

Author: lofwyr
Date: Mon Sep 25 09:22:57 2006
New Revision: 449721

URL: http://svn.apache.org/viewvc?view=rev&rev=449721
Log:
fix TOBAGO-12

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
    myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
    myfaces/tobago/trunk/tobago-tool/gendoc/src/main/webapp/screenshot/date.jsp

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java?view=diff&rev=449721&r1=449720&r2=449721
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java Mon Sep 25 09:22:57 2006
@@ -16,33 +16,35 @@
  * limitations under the License.
  */
 
-import org.apache.myfaces.tobago.event.DatePickerController;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_PICKER_POPUP;
+import org.apache.myfaces.tobago.TobagoConstants;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALT;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CALENDAR_DATE_INPUT_ID;
-import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_HIDDEN;
-import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_POPUP;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_POPUP_RESET;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_COLUMNS;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_HEIGHT;
-import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_BOX;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL;
-import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_GRID_LAYOUT;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_LAYOUT;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_POPUP_RESET;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ROWS;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SPAN_X;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_CLASS;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_LAYOUT;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_PICKER_POPUP;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_BOX;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_BUTTON;
 import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_CALENDAR;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_GRID_LAYOUT;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_HIDDEN;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_IMAGE;
 import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_PANEL;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_COLUMNS;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_POPUP;
 import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_TIME;
-import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_BUTTON;
-import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_IMAGE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALT;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_CLASS;
 import org.apache.myfaces.tobago.config.ThemeConfig;
+import org.apache.myfaces.tobago.event.DatePickerController;
 
-import javax.faces.context.FacesContext;
-import javax.faces.event.FacesEvent;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIGraphic;
+import javax.faces.context.FacesContext;
+import javax.faces.event.FacesEvent;
 import java.util.Map;
 
 /**
@@ -52,9 +54,10 @@
  * Time: 19:22:40
  * To change this template use File | Settings | File Templates.
  */
-public class UIDatePicker extends UICommand  implements OnComponentCreated {
- 
-  public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.DatePicker";
+public class UIDatePicker extends UICommand implements OnComponentCreated {
+
+  public static final String COMPONENT_TYPE =
+      "org.apache.myfaces.tobago.DatePicker";
 
   private String forComponent;
 
@@ -84,7 +87,7 @@
   public String getFor() {
     if ("@auto".equals(forComponent)) {
       UIComponent component = getUIDateInput(getParent());
-      if (component == null&&getParent() instanceof UIForm) {
+      if (component == null && getParent() instanceof UIForm) {
         component = getUIDateInput(getParent().getParent());
       }
       if (component != null) {
@@ -97,7 +100,7 @@
   public UIComponent getForComponent() {
     if ("@auto".equals(forComponent)) {
       UIComponent component = getUIDateInput(getParent());
-      if (component == null&&getParent() instanceof UIForm) {
+      if (component == null && getParent() instanceof UIForm) {
         component = getUIDateInput(getParent().getParent());
       }
       return component;
@@ -115,7 +118,7 @@
     UIPopup popup = (UIPopup) getFacets().get(FACET_PICKER_POPUP);
     String clientId = getForComponent().getClientId(facesContext);
     UIComponent box = popup.findComponent("box");
-    UIComponent calendar  = box.findComponent("calendar");
+    UIComponent calendar = box.findComponent("calendar");
     calendar.getAttributes().put(ATTR_CALENDAR_DATE_INPUT_ID, clientId);
     popup.setRendered(true);
   }
@@ -135,18 +138,20 @@
     link.setImmediate(true);
 
     UIInput hidden =
-        (UIInput) ComponentUtil.createComponent(facesContext, UIInput.COMPONENT_TYPE, RENDERER_TYPE_HIDDEN);
+        (UIInput) ComponentUtil.createComponent(facesContext,
+            UIInput.COMPONENT_TYPE, RENDERER_TYPE_HIDDEN);
     link.getChildren().add(hidden);
 
     // create popup
     final UIComponent popup =
-        ComponentUtil.createComponent(facesContext, UIPopup.COMPONENT_TYPE, RENDERER_TYPE_POPUP);
+        ComponentUtil.createComponent(facesContext, UIPopup.COMPONENT_TYPE,
+            RENDERER_TYPE_POPUP);
     //popup.setId(link.getId() + "popup");
     link.getFacets().put(FACET_PICKER_POPUP, popup);
 
     popup.setRendered(false);
 
-    Map<String, Object>  attributes = popup.getAttributes();
+    Map<String, Object> attributes = popup.getAttributes();
     attributes.put(ATTR_POPUP_RESET, Boolean.TRUE);
     attributes.put(ATTR_WIDTH, String.valueOf(
         ThemeConfig.getValue(facesContext, link, "CalendarPopupWidth")));
@@ -161,14 +166,17 @@
         facesContext, UIGridLayout.COMPONENT_TYPE, RENDERER_TYPE_GRID_LAYOUT);
     box.getFacets().put(FACET_LAYOUT, layout);
     layout.setId("layout");
-    layout.getAttributes().put(ATTR_ROWS, "1*;fixed;fixed;fixed");
+    layout.getAttributes().put(ATTR_ROWS, "*;fixed;fixed");
+//    layout.getAttributes().put(TobagoConstants.ATTR_BORDER, "1");
 
     final UIComponent calendar = ComponentUtil.createComponent(
-        facesContext, javax.faces.component.UIOutput.COMPONENT_TYPE, RENDERER_TYPE_CALENDAR);
-    box.getChildren().add(calendar);
+        facesContext, javax.faces.component.UIOutput.COMPONENT_TYPE,
+        RENDERER_TYPE_CALENDAR);
+
     calendar.setId("calendar");
+    box.getChildren().add(calendar);
 
-      // add time input
+    // add time input
     final UIComponent timePanel = ComponentUtil.createComponent(
         facesContext, UIPanel.COMPONENT_TYPE, RENDERER_TYPE_PANEL);
     timePanel.setId("timePanel");
@@ -184,7 +192,9 @@
     timePanel.getChildren().add(cell);
 
     final UIComponent time = ComponentUtil.createComponent(
-        facesContext, org.apache.myfaces.tobago.component.UIInput.COMPONENT_TYPE, RENDERER_TYPE_TIME);
+        facesContext,
+        org.apache.myfaces.tobago.component.UIInput.COMPONENT_TYPE,
+        RENDERER_TYPE_TIME);
     timePanel.getChildren().add(time);
     time.setId("time");
 
@@ -193,17 +203,30 @@
     cell.setId("cell2");
     timePanel.getChildren().add(cell);
 
-
-    final UICommand okButton = (UICommand) ComponentUtil.createComponent(facesContext,
-        org.apache.myfaces.tobago.component.UICommand.COMPONENT_TYPE, RENDERER_TYPE_BUTTON);
-    box.getChildren().add(okButton);
+    UIComponent buttonPanel = ComponentUtil.createComponent(
+        facesContext, UIPanel.COMPONENT_TYPE, RENDERER_TYPE_PANEL);
+    layout = ComponentUtil.createComponent(
+        facesContext, UIGridLayout.COMPONENT_TYPE, RENDERER_TYPE_GRID_LAYOUT);
+    buttonPanel.getFacets().put(FACET_LAYOUT, layout);
+    layout.getAttributes().put(ATTR_COLUMNS, "*;*");
+//    layout.getAttributes().put(TobagoConstants.ATTR_BORDER, "1");
+
+    box.getChildren().add(buttonPanel);
+
+    final UICommand okButton =
+        (UICommand) ComponentUtil.createComponent(facesContext,
+            org.apache.myfaces.tobago.component.UICommand.COMPONENT_TYPE,
+            RENDERER_TYPE_BUTTON);
+    buttonPanel.getChildren().add(okButton);
     okButton.setId("ok" + DatePickerController.CLOSE_POPUP);
     attributes = okButton.getAttributes();
     attributes.put(ATTR_LABEL, "OK");
 
-    final UICommand cancelButton = (UICommand) ComponentUtil.createComponent(facesContext,
-        org.apache.myfaces.tobago.component.UICommand.COMPONENT_TYPE, RENDERER_TYPE_BUTTON);
-    box.getChildren().add(cancelButton);
+    final UICommand cancelButton =
+        (UICommand) ComponentUtil.createComponent(facesContext,
+            org.apache.myfaces.tobago.component.UICommand.COMPONENT_TYPE,
+            RENDERER_TYPE_BUTTON);
+    buttonPanel.getChildren().add(cancelButton);
     attributes = cancelButton.getAttributes();
     attributes.put(ATTR_LABEL, "Cancel");
     cancelButton.setId(DatePickerController.CLOSE_POPUP);

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties?view=diff&rev=449721&r1=449720&r2=449721
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties Mon Sep 25 09:22:57 2006
@@ -29,7 +29,7 @@
 Tobago.labelWidth=120
 Tobago.labelSpace=5
 Tobago.fixedHeight=20
-Tobago.CalendarPopupHeight=325
+Tobago.CalendarPopupHeight=260
 
 TabGroup.paddingHeight=22
 TabGroup.paddingWidth=23

Modified: myfaces/tobago/trunk/tobago-tool/gendoc/src/main/webapp/screenshot/date.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/gendoc/src/main/webapp/screenshot/date.jsp?view=diff&rev=449721&r1=449720&r2=449721
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/gendoc/src/main/webapp/screenshot/date.jsp (original)
+++ myfaces/tobago/trunk/tobago-tool/gendoc/src/main/webapp/screenshot/date.jsp Mon Sep 25 09:22:57 2006
@@ -14,6 +14,7 @@
  *    limitations under the License.
 --%>
 <%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
+<%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
 <%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
 
@@ -22,11 +23,20 @@
     <f:subview id="date">
       <tc:panel>
         <f:facet name="layout">
-          <tc:gridLayout columns="300px;1*" rows="fixed;1*" />
+          <tc:gridLayout columns="300px;1*" rows="fixed;fixed;1*" />
         </f:facet>
 <%-- code-sniplet-start id="date" --%>
-        <tc:date label="Day of birth" />
+        <tx:date label="Date">
+          <f:convertDateTime pattern="dd.MM.yyyy" />
+        </tx:date>
 <%-- code-sniplet-end id="date" --%>
+        <tc:cell/>
+
+<%-- code-sniplet-start id="dateTime" --%>
+        <tx:date label="Date/Time">
+          <f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
+        </tx:date>
+<%-- code-sniplet-end id="dateTime" --%>
         <tc:cell/>
 
         <tc:cell spanX="2"/>