myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r910197 - /myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
Date Mon, 15 Feb 2010 10:54:42 GMT
Author: lofwyr
Date: Mon Feb 15 10:54:41 2010
New Revision: 910197

URL: http://svn.apache.org/viewvc?rev=910197&view=rev
Log:
code style

Modified:
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java?rev=910197&r1=910196&r2=910197&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
Mon Feb 15 10:54:41 2010
@@ -55,7 +55,9 @@
 import static javax.faces.convert.DateTimeConverter.CONVERTER_ID;
 
 public class DatePickerRenderer extends LinkRenderer {
+
   private static final Log LOG = LogFactory.getLog(DatePickerRenderer.class);
+
   public static final String CLOSE_POPUP = "closePopup";
 
   @Override
@@ -63,12 +65,12 @@
     preparePicker(context, (UIDatePicker) component);
   }
 
-  public void preparePicker(FacesContext facesContext, UIDatePicker link) {
-    if (link.getFor() == null) {
-      link.setFor("@auto");
+  public void preparePicker(FacesContext facesContext, UIDatePicker picker) {
+    if (picker.getFor() == null) {
+      picker.setFor("@auto");
     }
-    link.setImmediate(true);
-    String linkId = link.getId();
+    picker.setImmediate(true);
+    String linkId = picker.getId();
     UIHiddenInput hidden = (UIHiddenInput)
         CreateComponentUtils.createComponent(facesContext, UIHiddenInput.COMPONENT_TYPE,
RendererTypes.HIDDEN);
     if (linkId != null) {
@@ -76,7 +78,7 @@
     } else {
       hidden.setId(facesContext.getViewRoot().createUniqueId());
     }
-    link.getChildren().add(hidden);
+    picker.getChildren().add(hidden);
 
     // create popup
     final AbstractUIPopup popup =
@@ -89,7 +91,7 @@
     }
     popup.getAttributes().put(Attributes.Z_INDEX, 10);
 
-    link.getFacets().put(Facets.PICKER_POPUP, popup);
+    picker.getFacets().put(Facets.PICKER_POPUP, popup);
 
     popup.setRendered(false);
 
@@ -180,7 +182,7 @@
     image.setValue("image/date.gif");
     image.getAttributes().put(Attributes.ALT, ""); //TODO: i18n
     StyleClasses.ensureStyleClasses(image).addFullQualifiedClass("tobago-input-picker");
// XXX not a standard name
-    link.getChildren().add(image);
+    picker.getChildren().add(image);
   }
 
 
@@ -202,32 +204,32 @@
   }
 
   public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException
{
-    UIDatePicker link = (UIDatePicker) component;
+    UIDatePicker picker = (UIDatePicker) component;
 //    DatePickerController datePickerController = new DatePickerController();
-    UIDate dateInput = (UIDate) link.getForComponent();
+    UIDate dateInput = (UIDate) picker.getForComponent();
     if (dateInput == null) {
       LOG.error("No required UIDate component found.");
       return;
     }
     if (FacesUtils.hasValueBindingOrValueExpression(dateInput, Attributes.READONLY)) {
-      FacesUtils.copyValueBindingOrValueExpression(link, Attributes.DISABLED,
+      FacesUtils.copyValueBindingOrValueExpression(picker, Attributes.DISABLED,
           dateInput, Attributes.READONLY);
     } else {
       if (FacesUtils.hasValueBindingOrValueExpression(dateInput, Attributes.DISABLED)) {
-        FacesUtils.copyValueBindingOrValueExpression(link, Attributes.DISABLED,
+        FacesUtils.copyValueBindingOrValueExpression(picker, Attributes.DISABLED,
             dateInput, Attributes.DISABLED);
       } else {
-        link.setDisabled(dateInput.isReadonly() || dateInput.isDisabled());
+        picker.setDisabled(dateInput.isReadonly() || dateInput.isDisabled());
       }
     }
-    Map<String, Object> attributes = link.getAttributes();
-//    link.setActionListener(datePickerController);
+    Map<String, Object> attributes = picker.getAttributes();
+//    picker.setActionListener(datePickerController);
 
-    UIComponent hidden = (UIComponent) link.getChildren().get(0);
-    UIPopup popup = (UIPopup) link.getFacets().get(Facets.PICKER_POPUP);
+    UIComponent hidden = (UIComponent) picker.getChildren().get(0);
+    UIPopup popup = (UIPopup) picker.getFacets().get(Facets.PICKER_POPUP);
 
     attributes.put(Attributes.ONCLICK, "Tobago.openPickerPopup(event, '"
-        + link.getClientId(facesContext) + "', '"
+        + picker.getClientId(facesContext) + "', '"
         + hidden.getClientId(facesContext) + "', '"
         + popup.getClientId(facesContext) + "')");
 
@@ -252,8 +254,8 @@
 
     applyConverterPattern(facesContext, popup, converterPattern);
 
-    if (!ComponentUtils.containsPopupActionListener(link)) {
-      link.addActionListener(new PopupActionListener(popup.getId()));
+    if (!ComponentUtils.containsPopupActionListener(picker)) {
+      picker.addActionListener(new PopupActionListener(popup.getId()));
     }
     super.encodeBegin(facesContext, component);
   }



Mime
View raw message