myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r928831 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/config/ core/src/main/resources/org/apache/myfaces/tobago/config/ example/addressbook/war/src/main/webapp/WEB-INF/ example/demo/src/main/webapp/WEB-INF/ exampl...
Date Mon, 29 Mar 2010 16:43:49 GMT
Author: lofwyr
Date: Mon Mar 29 16:43:49 2010
New Revision: 928831

URL: http://svn.apache.org/viewvc?rev=928831&view=rev
Log:
TOBAGO-867: remove ajax-enabled from tobago config

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
    myfaces/tobago/trunk/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
    myfaces/tobago/trunk/example/addressbook/war/src/main/webapp/WEB-INF/tobago-config.xml
    myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/tobago-config.xml
    myfaces/tobago/trunk/example/experimental/src/main/webapp/WEB-INF/tobago-config.xml
    myfaces/tobago/trunk/example/retro/src/main/webapp/WEB-INF/tobago-config.xml
    myfaces/tobago/trunk/example/sandbox/src/main/webapp/WEB-INF/tobago-config.xml
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
Mon Mar 29 16:43:49 2010
@@ -22,6 +22,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.myfaces.tobago.application.ProjectStage;
 import org.apache.myfaces.tobago.context.RenderersConfig;
 import org.apache.myfaces.tobago.context.Theme;
+import org.apache.myfaces.tobago.internal.util.Deprecation;
 import org.apache.myfaces.tobago.internal.util.JndiUtils;
 
 import javax.faces.context.FacesContext;
@@ -45,7 +46,6 @@ public class TobagoConfig {
   private Theme defaultTheme;
   private String defaultThemeName;
   private List<String> resourceDirs;
-  private boolean ajaxEnabled;
   private Map<String, Theme> availableTheme;
   private RenderersConfig renderersConfig;
   private ProjectStage projectStage;
@@ -54,7 +54,6 @@ public class TobagoConfig {
     supportedThemeNames = new ArrayList<String>();
     supportedThemes = new ArrayList<Theme>();
     resourceDirs = new ArrayList<String>();
-    ajaxEnabled = true;
   }
 
   public void addSupportedThemeName(String name) {
@@ -157,12 +156,17 @@ public class TobagoConfig {
     return resourceDirs;
   }
 
+  /** @deprecated */
+  @Deprecated
   public boolean isAjaxEnabled() {
-    return ajaxEnabled;
+    Deprecation.LOG.warn("Ajax is always enabled!");
+    return true;
   }
 
+  /** @deprecated */
+  @Deprecated
   public void setAjaxEnabled(String value) {
-    this.ajaxEnabled = Boolean.valueOf(value);
+    Deprecation.LOG.error("Ajax is always enabled!");
   }
 
   public Theme getDefaultTheme() {

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
Mon Mar 29 16:43:49 2010
@@ -59,8 +59,7 @@ public class TobagoConfigParser {
     // resource dirs
     digester.addCallMethod("tobago-config/resource-dir", "addResourceDir", 0);
 
-    // enable ajax
-    digester.addCallMethod("tobago-config/ajax-enabled", "setAjaxEnabled", 0);
+    // renderer config
     digester.addObjectCreate("tobago-config/renderers", RenderersConfigImpl.class);
     digester.addSetNext("tobago-config/renderers", "setRenderersConfig");
     digester.addObjectCreate("tobago-config/renderers/renderer", RendererConfig.class);

Modified: myfaces/tobago/trunk/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
(original)
+++ myfaces/tobago/trunk/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
Mon Mar 29 16:43:49 2010
@@ -45,6 +45,7 @@
 <!ELEMENT key (#PCDATA)>
 <!ELEMENT value (#PCDATA)>
 
+<!-- deprecated -->
 <!ELEMENT ajax-enabled (#PCDATA)>
 
 <!ELEMENT renderers (renderer)*>

Modified: myfaces/tobago/trunk/example/addressbook/war/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/war/src/main/webapp/WEB-INF/tobago-config.xml?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/war/src/main/webapp/WEB-INF/tobago-config.xml
(original)
+++ myfaces/tobago/trunk/example/addressbook/war/src/main/webapp/WEB-INF/tobago-config.xml
Mon Mar 29 16:43:49 2010
@@ -30,7 +30,6 @@
   </theme-config>
 
   <resource-dir>addressbook-resource</resource-dir>
-  <ajax-enabled>true</ajax-enabled>
   <renderers>
     <renderer>
       <name>Progress</name>

Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/tobago-config.xml?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/tobago-config.xml Mon Mar 29
16:43:49 2010
@@ -30,5 +30,4 @@
   </theme-config>
 
   <resource-dir>tobago-resource</resource-dir>
-  <ajax-enabled>true</ajax-enabled>
 </tobago-config>

Modified: myfaces/tobago/trunk/example/experimental/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/experimental/src/main/webapp/WEB-INF/tobago-config.xml?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/experimental/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/example/experimental/src/main/webapp/WEB-INF/tobago-config.xml Mon
Mar 29 16:43:49 2010
@@ -27,5 +27,4 @@
   </theme-config>
 
   <resource-dir>tobago-resource</resource-dir>
-  <ajax-enabled>true</ajax-enabled>
 </tobago-config>

Modified: myfaces/tobago/trunk/example/retro/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/retro/src/main/webapp/WEB-INF/tobago-config.xml?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/retro/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/example/retro/src/main/webapp/WEB-INF/tobago-config.xml Mon Mar 29
16:43:49 2010
@@ -28,5 +28,4 @@
 
   <resource-dir>tobago-resource</resource-dir>
   <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
-  <ajax-enabled>true</ajax-enabled>
 </tobago-config>

Modified: myfaces/tobago/trunk/example/sandbox/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/sandbox/src/main/webapp/WEB-INF/tobago-config.xml?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/sandbox/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/example/sandbox/src/main/webapp/WEB-INF/tobago-config.xml Mon Mar
29 16:43:49 2010
@@ -28,7 +28,4 @@
 
   <resource-dir>tobago-resource</resource-dir>
   <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
-
-  <ajax-enabled>true</ajax-enabled>
-  
 </tobago-config>

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
Mon Mar 29 16:43:49 2010
@@ -17,14 +17,8 @@ package org.apache.myfaces.tobago.render
  * limitations under the License.
  */
 
-/*
- * Created 07.02.2003 16:00:00.
- * $Id$
- */
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.config.TobagoConfig;
 import org.apache.myfaces.tobago.context.TobagoFacesContext;
 import org.apache.myfaces.tobago.internal.util.DateFormatUtils;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -48,6 +42,7 @@ public class DateRenderer extends InRend
       "script/calendar.js"
     };
 
+  @Override
   public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException
{
     super.prepareRender(facesContext, component);
     if (facesContext instanceof TobagoFacesContext) {
@@ -55,11 +50,11 @@ public class DateRenderer extends InRend
     }
   }
 
+  @Override
   public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException
{
 
-    if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()) {
-      HtmlRendererUtils.writeScriptLoader(facesContext, SCRIPTS, null);
-    }
+    // for AJAX
+    HtmlRendererUtils.writeScriptLoader(facesContext, SCRIPTS, null);
 
     super.encodeEnd(facesContext, component);
 
@@ -78,8 +73,7 @@ public class DateRenderer extends InRend
         writer.writeAttribute(HtmlAttributes.VALUE, pattern, false);
         writer.endElement(HtmlConstants.INPUT);
       } else {
-        LOG.warn("Can't find the pattern for the converter! "
-            + "DatePicker may not work correctly.");
+        LOG.warn("Can't find the pattern for the converter! DatePicker may not work correctly.");
       }
     }
   }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
Mon Mar 29 16:43:49 2010
@@ -150,7 +150,7 @@ public class SheetRenderer extends Layou
         frequency = update.getFrequency();
       }
       final String[] cmds = {
-          "new Tobago.Sheet(\"" + sheetId + "\", " + true
+          "new Tobago.Sheet(\"" + sheetId + "\", " + true // ajaxEnabled=true (deprecated)
               + ", \"" + checked + "\", \"" + unchecked + "\", \"" + sheet.getSelectable()
               + "\", " + columnSelectorIndex + ", " + frequency
               + ",  " + (clickAction != null ? HtmlRendererUtils.getJavascriptString(clickAction.getId())
: null)

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
Mon Mar 29 16:43:49 2010
@@ -27,7 +27,6 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UITab;
 import org.apache.myfaces.tobago.component.UITabGroup;
 import org.apache.myfaces.tobago.component.UIToolBar;
-import org.apache.myfaces.tobago.config.TobagoConfig;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.context.TobagoFacesContext;
 import org.apache.myfaces.tobago.event.TabChangeEvent;
@@ -107,9 +106,8 @@ public class TabGroupRenderer extends La
     final String hiddenId = clientId + TabGroupRenderer.ACTIVE_INDEX_POSTFIX;
     final String switchType = tabGroup.getSwitchType();
 
-    if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()) {
-      HtmlRendererUtils.writeScriptLoader(facesContext, SCRIPTS, ArrayUtils.EMPTY_STRING_ARRAY);
-    }
+    // AJAX
+    HtmlRendererUtils.writeScriptLoader(facesContext, SCRIPTS, ArrayUtils.EMPTY_STRING_ARRAY);
 
     TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
     writer.startElement(HtmlConstants.INPUT, null);
@@ -155,8 +153,7 @@ public class TabGroupRenderer extends La
                 switchType, image1x1, navigationBarWidth, currentWidth, tabList);
             writer.endElement(HtmlConstants.DIV);
 
-            if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()
-                && UITabGroup.SWITCH_TYPE_RELOAD_TAB.equals(switchType)) {
+            if (UITabGroup.SWITCH_TYPE_RELOAD_TAB.equals(switchType)) {
               final String[] cmds = {
                   "new Tobago.TabGroup(",
                   "    '" + clientId + "', ",
@@ -317,8 +314,7 @@ public class TabGroupRenderer extends La
         UITab tab = (UITab) child;
         if (tab.isRendered()) {
           String onclick;
-          if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()
-              && UITabGroup.SWITCH_TYPE_RELOAD_TAB.equals(switchType)) {
+          if (UITabGroup.SWITCH_TYPE_RELOAD_TAB.equals(switchType)) {
             onclick = null;
           } else {
             onclick = "tobago_switchTab('"+ switchType + "','" + clientId + "'," + index
+ ','

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
(original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
Mon Mar 29 16:43:49 2010
@@ -40,12 +40,12 @@ Tobago.Sheets = {
 
 };
 
+// XXX: 2nd parameter enableAjax is deprecated
 Tobago.Sheet = function(sheetId, enableAjax, checkedImage, uncheckedImage, selectable, columnSelectorIndex,
autoReload,
                         clickActionId, clickReloadComponentId, dblClickActionId, dblClickReloadComponentId)
{
   this.startTime = new Date();
   this.id = sheetId;
   Tobago.Sheets.put(this);
-  this.ajaxEnabled = enableAjax;
   this.checkedImage = checkedImage;
   this.uncheckedImage = uncheckedImage;
   this.selectable = selectable;
@@ -392,12 +392,10 @@ Tobago.Sheet.prototype.setup = function(
         this.updateSelectionView();
       }
 
-      if (this.ajaxEnabled) {
-        this.setupSortHeaders();
-        this.setupPagingLinks();
-        this.setupPagePaging();
-        this.setupRowPaging();
-      }
+      this.setupSortHeaders();
+      this.setupPagingLinks();
+      this.setupPagePaging();
+      this.setupRowPaging();
     }
     this.initReload();
     this.setupEnd = new Date();

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=928831&r1=928830&r2=928831&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
(original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Mon Mar 29 16:43:49 2010
@@ -1042,9 +1042,9 @@ var Tobago = {
   /**
    * remove a popup without request
    */
-  closePopup: function(element) {
+  closePopup: function(closeButton) {
     Tobago.unlockBehindPopup();
-    var popup = jQuery(element).parents("div.tobago-popup-default:first");
+    var popup = jQuery(closeButton).parents("div.tobago-popup-default:first");
     popup.remove();
     Tobago.setupPopup();
   },
@@ -1842,16 +1842,15 @@ Tobago.In.prototype.leaveRequired = func
   }
 };
 
+// XXX: 2nd parameter enableAjax is deprecated
 Tobago.Panel = function(panelId, enableAjax, autoReload) {
   this.startTime = new Date();
   this.id = panelId;
-  this.ajaxEnabled = enableAjax;
   this.autoReload = autoReload;
 
-  if (this.ajaxEnabled) {
-    this.options = {
-    };
-  }
+  this.options = {
+  };
+
   //LOG.debug("Panel setup  " + this.id);
   this.setup();
   Tobago.addAjaxComponent(this.id, this);



Mime
View raw message