Author: nbelaevski
Date: 2009-04-23 20:07:07 -0400 (Thu, 23 Apr 2009)
New Revision: 13813
Added:
trunk/ui/dataTable/src/main/java/org/richfaces/taglib/RowKeyConverterComponentHandler.java
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
trunk/ui/dataTable/src/main/config/component/dataGrid.xml
trunk/ui/dataTable/src/main/config/component/dataList.xml
trunk/ui/dataTable/src/main/config/component/dataTable.xml
trunk/ui/dataTable/src/main/config/component/subTable.xml
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/taglib/ScrollableDataTableTagHandler.java
Log:
https://jira.jboss.org/jira/browse/RF-6912
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
===================================================================
---
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java 2009-04-24
00:05:03 UTC (rev 13812)
+++
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java 2009-04-24
00:07:07 UTC (rev 13813)
@@ -20,83 +20,12 @@
*/
package org.ajax4jsf.taglib.html.facelets;
-import javax.faces.convert.Converter;
-import org.ajax4jsf.component.UIDataAdaptor;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
-
/**
* Apply rowKeyConverter to component
* @author Maksim Kaszynski
- *
*/
-public class RowKeyConverterRule extends MetaRule {
+@Deprecated
+public class RowKeyConverterRule extends org.ajax4jsf.webapp.taglib.RowKeyConverterRule
{
- static final class DynamicConverterMetaData extends Metadata {
-
- private final TagAttribute attribute;
-
- public DynamicConverterMetaData(TagAttribute attribute) {
- super();
- this.attribute = attribute;
- }
-
- @Override
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIDataAdaptor) instance).setValueExpression("rowKeyConverter",
- attribute.getValueExpression(ctx, Converter.class));
-
- }
- }
-
- static final class StaticConverterMetadata extends Metadata {
-
- private final String converterId;
-
- public StaticConverterMetadata(String converterId) {
- super();
- this.converterId = converterId;
- }
-
- @Override
- public void applyMetadata(FaceletContext ctx, Object instance) {
- Converter converter = ctx.getFacesContext().getApplication()
- .createConverter(converterId);
- ((UIDataAdaptor) instance).setRowKeyConverter(converter);
-
- }
- }
-
- public static final RowKeyConverterRule INSTANCE = new RowKeyConverterRule();
-
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)
- */
- @Override
- public Metadata applyRule(String name, TagAttribute attribute,
- MetadataTarget meta) {
-
- if (meta.isTargetInstanceOf(UIDataAdaptor.class)) {
- if ("rowKeyConverter".equals(name)) {
- if (attribute.isLiteral()) {
- return new StaticConverterMetadata(attribute.getValue());
- } else {
- return new DynamicConverterMetaData(attribute);
- }
- }
- }
-
- return null;
- }
-
}
Modified: trunk/ui/dataTable/src/main/config/component/dataGrid.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataGrid.xml 2009-04-24 00:05:03 UTC (rev
13812)
+++ trunk/ui/dataTable/src/main/config/component/dataGrid.xml 2009-04-24 00:07:07 UTC (rev
13813)
@@ -39,11 +39,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
Modified: trunk/ui/dataTable/src/main/config/component/dataList.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataList.xml 2009-04-24 00:05:03 UTC (rev
13812)
+++ trunk/ui/dataTable/src/main/config/component/dataList.xml 2009-04-24 00:07:07 UTC (rev
13813)
@@ -27,11 +27,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
@@ -132,11 +131,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
@@ -242,11 +240,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
Modified: trunk/ui/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataTable.xml 2009-04-24 00:05:03 UTC
(rev 13812)
+++ trunk/ui/dataTable/src/main/config/component/dataTable.xml 2009-04-24 00:07:07 UTC
(rev 13813)
@@ -39,11 +39,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
Modified: trunk/ui/dataTable/src/main/config/component/subTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/subTable.xml 2009-04-24 00:05:03 UTC (rev
13812)
+++ trunk/ui/dataTable/src/main/config/component/subTable.xml 2009-04-24 00:07:07 UTC (rev
13813)
@@ -36,11 +36,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&spec_table_attributes;
Added:
trunk/ui/dataTable/src/main/java/org/richfaces/taglib/RowKeyConverterComponentHandler.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/taglib/RowKeyConverterComponentHandler.java
(rev 0)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/taglib/RowKeyConverterComponentHandler.java 2009-04-24
00:07:07 UTC (rev 13813)
@@ -0,0 +1,45 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.taglib;
+
+import org.ajax4jsf.webapp.taglib.RowKeyConverterRule;
+
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+public class RowKeyConverterComponentHandler extends ComponentHandler {
+
+ public RowKeyConverterComponentHandler(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ return super.createMetaRuleset(type).addRule(RowKeyConverterRule.INSTANCE);
+ }
+}
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/taglib/ScrollableDataTableTagHandler.java
===================================================================
---
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/taglib/ScrollableDataTableTagHandler.java 2009-04-24
00:05:03 UTC (rev 13812)
+++
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/taglib/ScrollableDataTableTagHandler.java 2009-04-24
00:07:07 UTC (rev 13813)
@@ -20,8 +20,9 @@
*/
package org.richfaces.taglib;
-import org.ajax4jsf.taglib.html.facelets.RowKeyConverterRule;
+import org.ajax4jsf.webapp.taglib.RowKeyConverterRule;
+
import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.jsf.ComponentConfig;
import com.sun.facelets.tag.jsf.ComponentHandler;