Author: nbelaevski
Date: 2010-12-16 15:23:35 -0500 (Thu, 16 Dec 2010)
New Revision: 20627
Added:
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/StringSequenceRowKeyConverter.java
Removed:
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/ObjectSequenceRowKeyConverter.java
Modified:
trunk/core/api/src/main/java/org/richfaces/component/ComponentIterators.java
trunk/ui/iteration/ui/src/main/config/faces-config.xml
trunk/ui/iteration/ui/src/main/java/org/richfaces/model/ClassicTreeNodeDataModelImpl.java
Log:
Tree converter names refactoring
Added TODO for ComponentIterators class
Modified: trunk/core/api/src/main/java/org/richfaces/component/ComponentIterators.java
===================================================================
---
trunk/core/api/src/main/java/org/richfaces/component/ComponentIterators.java 2010-12-16
19:43:06 UTC (rev 20626)
+++
trunk/core/api/src/main/java/org/richfaces/component/ComponentIterators.java 2010-12-16
20:23:35 UTC (rev 20627)
@@ -36,6 +36,7 @@
private ComponentIterators() {}
+ //TODO nick - convert to filter/find functions
public static Iterator<UIComponent> parents(final UIComponent component) {
if (component == null) {
return Iterators.<UIComponent>emptyIterator();
Modified: trunk/ui/iteration/ui/src/main/config/faces-config.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/config/faces-config.xml 2010-12-16 19:43:06 UTC (rev
20626)
+++ trunk/ui/iteration/ui/src/main/config/faces-config.xml 2010-12-16 20:23:35 UTC (rev
20627)
@@ -17,8 +17,8 @@
</converter>
<converter>
-
<converter-id>org.richfaces.ObjectSequenceRowKeyConverter</converter-id>
-
<converter-class>org.richfaces.convert.ObjectSequenceRowKeyConverter</converter-class>
+
<converter-id>org.richfaces.StringSequenceRowKeyConverter</converter-id>
+
<converter-class>org.richfaces.convert.StringSequenceRowKeyConverter</converter-class>
</converter>
<faces-config-extension>
Deleted:
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/ObjectSequenceRowKeyConverter.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/ObjectSequenceRowKeyConverter.java 2010-12-16
19:43:06 UTC (rev 20626)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/ObjectSequenceRowKeyConverter.java 2010-12-16
20:23:35 UTC (rev 20627)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.convert;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class ObjectSequenceRowKeyConverter extends SequenceRowKeyConverter<Object>
{
-
- public static final String CONVERTER_ID =
"org.richfaces.ObjectSequenceRowKeyConverter";
-
- private static final Converter NO_OP_CONVERTER = new Converter() {
-
- public String getAsString(FacesContext context, UIComponent component, Object
value) {
- return (String) value;
- }
-
- public Object getAsObject(FacesContext context, UIComponent component, String
value) {
- return value;
- }
- };
-
- public ObjectSequenceRowKeyConverter() {
- super(Object.class, NO_OP_CONVERTER);
- }
-
-}
Copied:
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/StringSequenceRowKeyConverter.java
(from rev 20604,
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/ObjectSequenceRowKeyConverter.java)
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/StringSequenceRowKeyConverter.java
(rev 0)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/convert/StringSequenceRowKeyConverter.java 2010-12-16
20:23:35 UTC (rev 20627)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.convert;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class StringSequenceRowKeyConverter extends SequenceRowKeyConverter<Object>
{
+
+ public static final String CONVERTER_ID =
"org.richfaces.StringSequenceRowKeyConverter";
+
+ public StringSequenceRowKeyConverter() {
+ super(Object.class, ConverterUtil.stringConverter());
+ }
+
+}
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/model/ClassicTreeNodeDataModelImpl.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/model/ClassicTreeNodeDataModelImpl.java 2010-12-16
19:43:06 UTC (rev 20626)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/model/ClassicTreeNodeDataModelImpl.java 2010-12-16
20:23:35 UTC (rev 20627)
@@ -25,7 +25,7 @@
import javax.faces.convert.Converter;
-import org.richfaces.convert.ObjectSequenceRowKeyConverter;
+import org.richfaces.convert.StringSequenceRowKeyConverter;
import org.richfaces.model.iterators.ClassicTreeNodeTuplesIterator;
/**
@@ -34,7 +34,7 @@
*/
public class ClassicTreeNodeDataModelImpl extends
NodesTreeSequenceKeyModel<TreeNode> {
- private static final Converter DEFAULT_CONVERTER = new
ObjectSequenceRowKeyConverter();
+ private static final Converter DEFAULT_CONVERTER = new
StringSequenceRowKeyConverter();
private TreeNode rootNode;