myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject cvs commit: incubator-myfaces/tlds myfaces_ext.tld
Date Mon, 17 Jan 2005 10:08:45 GMT
mmarinschek    2005/01/17 02:08:45

  Modified:    src/components/org/apache/myfaces/custom/calendar
                        HtmlCalendarRenderer.java HtmlInputCalendar.java
                        HtmlInputCalendar.xml HtmlInputCalendarTag.java
               tlds     myfaces_ext.tld
  Log:
  trying to fix problem with added resources to header; css and js was not changeable by the
user anymore...
  
  Revision  Changes    Path
  1.18      +6 -2      incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
  
  Index: HtmlCalendarRenderer.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- HtmlCalendarRenderer.java	9 Jan 2005 18:15:12 -0000	1.17
  +++ HtmlCalendarRenderer.java	17 Jan 2005 10:08:44 -0000	1.18
  @@ -46,6 +46,9 @@
   
   /**
    * $Log$
  + * Revision 1.18  2005/01/17 10:08:44  mmarinschek
  + * trying to fix problem with added resources to header; css and js was not changeable
by the user anymore...
  + *
    * Revision 1.17  2005/01/09 18:15:12  mmarinschek
    * small changes - better error handling, label renderer supports more hooks for sub-classes
    *
  @@ -131,7 +134,8 @@
   
           if(inputCalendar.isRenderAsPopup())
           {
  -            addScriptAndCSSResources(facesContext);
  +            if(inputCalendar.isAddResources())
  +                addScriptAndCSSResources(facesContext);
               
               String dateFormat = CalendarDateTimeConverter.createJSPopupFormat(facesContext,
                       inputCalendar.getPopupDateFormat());
  
  
  
  1.7       +43 -27    incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlInputCalendar.java
  
  Index: HtmlInputCalendar.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlInputCalendar.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HtmlInputCalendar.java	13 Oct 2004 11:50:57 -0000	1.6
  +++ HtmlInputCalendar.java	17 Jan 2005 10:08:44 -0000	1.7
  @@ -41,6 +41,7 @@
       private String _dayCellClass = null;
       private String _currentDayCellClass = null;
       private Boolean _renderAsPopup = null;
  +    private Boolean _addResources = null;
       private String _popupButtonString = null;
       private String _popupDateFormat = null;
       private String _enabledOnUserRole = null;
  @@ -125,6 +126,19 @@
           return v != null ? v.booleanValue() : false;
       }
   
  +    public void setAddResources(boolean addResources)
  +    {
  +        _addResources = Boolean.valueOf(addResources);
  +    }
  +
  +    public boolean isAddResources()
  +    {
  +        if (_addResources != null) return _addResources.booleanValue();
  +        ValueBinding vb = getValueBinding("addResources");
  +        Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
  +        return v != null ? v.booleanValue() : false;
  +    }
  +
       public void setPopupButtonString(String popupButtonString)
       {
           _popupButtonString = popupButtonString;
  @@ -278,25 +292,26 @@
   
       public Object saveState(FacesContext context)
       {
  -        Object values[] = new Object[18];
  +        Object values[] = new Object[19];
           values[0] = super.saveState(context);
           values[1] = _monthYearRowClass;
           values[2] = _weekRowClass;
           values[3] = _dayCellClass;
           values[4] = _currentDayCellClass;
           values[5] = _renderAsPopup;
  -        values[6] = _popupButtonString;
  -        values[7] = _popupDateFormat;
  -        values[8] = _enabledOnUserRole;
  -        values[9] = _visibleOnUserRole;
  -        values[10] = _popupGotoString;
  -        values[11] = _popupTodayString;
  -        values[12] = _popupWeekString;
  -        values[13] = _popupScrollLeftMessage;
  -        values[14] = _popupScrollRightMessage;
  -        values[15] = _popupSelectMonthMessage;
  -        values[16] = _popupSelectYearMessage;
  -        values[17] = _popupSelectDateMessage;
  +        values[6] = _addResources;
  +        values[7] = _popupButtonString;
  +        values[8] = _popupDateFormat;
  +        values[9] = _enabledOnUserRole;
  +        values[10] = _visibleOnUserRole;
  +        values[11] = _popupGotoString;
  +        values[12] = _popupTodayString;
  +        values[13] = _popupWeekString;
  +        values[14] = _popupScrollLeftMessage;
  +        values[15] = _popupScrollRightMessage;
  +        values[16] = _popupSelectMonthMessage;
  +        values[17] = _popupSelectYearMessage;
  +        values[18] = _popupSelectDateMessage;
           return ((Object) (values));
       }
   
  @@ -309,18 +324,19 @@
           _dayCellClass = (String)values[3];
           _currentDayCellClass = (String)values[4];
           _renderAsPopup = (Boolean)values[5];
  -        _popupButtonString = (String)values[6];
  -        _popupDateFormat = (String)values[7];
  -        _enabledOnUserRole = (String)values[8];
  -        _visibleOnUserRole = (String)values[9];
  -        _popupGotoString = (String)values[10];
  -        _popupTodayString = (String)values[11];
  -        _popupWeekString = (String)values[12];
  -        _popupScrollLeftMessage = (String)values[13];
  -        _popupScrollRightMessage = (String)values[14];
  -        _popupSelectMonthMessage = (String)values[15];
  -        _popupSelectYearMessage = (String)values[16];
  -        _popupSelectDateMessage = (String)values[17];
  +        _addResources = (Boolean)values[6];
  +        _popupButtonString = (String)values[7];
  +        _popupDateFormat = (String)values[8];
  +        _enabledOnUserRole = (String)values[9];
  +        _visibleOnUserRole = (String)values[10];
  +        _popupGotoString = (String)values[11];
  +        _popupTodayString = (String)values[12];
  +        _popupWeekString = (String)values[13];
  +        _popupScrollLeftMessage = (String)values[14];
  +        _popupScrollRightMessage = (String)values[15];
  +        _popupSelectMonthMessage = (String)values[16];
  +        _popupSelectYearMessage = (String)values[17];
  +        _popupSelectDateMessage = (String)values[18];
       }
       //------------------ GENERATED CODE END ---------------------------------------
   }
  
  
  
  1.7       +4 -0      incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlInputCalendar.xml
  
  Index: HtmlInputCalendar.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlInputCalendar.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HtmlInputCalendar.xml	29 Oct 2004 15:51:04 -0000	1.6
  +++ HtmlInputCalendar.xml	17 Jan 2005 10:08:44 -0000	1.7
  @@ -29,6 +29,10 @@
           <type>boolean</type>
       </field>
       <field>
  +        <name>addResources</name>
  +        <type>boolean</type>
  +    </field>
  +    <field>
           <name>popupButtonString</name>
           <type>java.lang.String</type>
       </field>
  
  
  
  1.10      +12 -2     incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlInputCalendarTag.java
  
  Index: HtmlInputCalendarTag.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlInputCalendarTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HtmlInputCalendarTag.java	13 Oct 2004 11:50:57 -0000	1.9
  +++ HtmlInputCalendarTag.java	17 Jan 2005 10:08:44 -0000	1.10
  @@ -24,6 +24,9 @@
    * @author Martin Marinschek (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.10  2005/01/17 10:08:44  mmarinschek
  + * trying to fix problem with added resources to header; css and js was not changeable
by the user anymore...
  + *
    * Revision 1.9  2004/10/13 11:50:57  matze
    * renamed packages to org.apache
    *
  @@ -85,6 +88,7 @@
       private String _dayCellClass;
       private String _currentDayCellClass;
       private String _renderAsPopup;
  +    private String _addResources;
       private String _popupDateFormat;
       private String _popupButtonString;
       private String _popupGotoString = null;
  @@ -109,6 +113,7 @@
           setStringProperty(component, "dayCellClass", _dayCellClass);
           setStringProperty(component, "currentDayCellClass", _currentDayCellClass);
           setBooleanProperty(component,"renderAsPopup",_renderAsPopup);
  +        setBooleanProperty(component,"addResources",(_addResources==null?Boolean.TRUE.toString():_addResources));
           setStringProperty(component,"popupDateFormat",_popupDateFormat);
           setStringProperty(component,"popupButtonString",_popupButtonString);
           setStringProperty(component,"popupGotoString",_popupGotoString);
  @@ -148,6 +153,11 @@
       public void setRenderAsPopup(String renderAsPopup)
       {
           _renderAsPopup = renderAsPopup;
  +    }
  +
  +    public void setAddResources(String addResources)
  +    {
  +        _addResources = addResources;
       }
   
       public void setPopupDateFormat(String popupDateFormat)
  
  
  
  1.153     +6 -0      incubator-myfaces/tlds/myfaces_ext.tld
  
  Index: myfaces_ext.tld
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/tlds/myfaces_ext.tld,v
  retrieving revision 1.152
  retrieving revision 1.153
  diff -u -r1.152 -r1.153
  --- myfaces_ext.tld	10 Jan 2005 08:22:17 -0000	1.152
  +++ myfaces_ext.tld	17 Jan 2005 10:08:44 -0000	1.153
  @@ -427,6 +427,12 @@
               <description>Render the input-calendar as a java-script popup on client.</description>
           </attribute>
           <attribute>
  +            <name>addResources</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +            <description>Automatically add the input-calendar scripts and css files
to the header - set that to false to provide the scripts yourself.</description>
  +        </attribute>
  +        <attribute>
               <name>popupDateFormat</name>
               <required>false</required>
               <rtexprvalue>false</rtexprvalue>
  
  
  

Mime
View raw message