You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2005/05/16 23:48:18 UTC
svn commit: r170466 - in /myfaces/trunk:
src/components/org/apache/myfaces/component/html/ext/
src/components/org/apache/myfaces/renderkit/html/ext/
src/components/org/apache/myfaces/taglib/html/ext/
src/share/org/apache/myfaces/component/
src/share/org/apache/myfaces/renderkit/html/ tlds/entities/
Author: mmarinschek
Date: Mon May 16 14:48:17 2005
New Revision: 170466
URL: http://svn.apache.org/viewcvs?rev=170466&view=rev
Log:
added new files
Added:
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.java
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.xml
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.xml
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.java
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.xml
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.java
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.xml
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.java
myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.xml
myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGridRenderer.java
myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java
myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java
myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectBooleanCheckboxTag.java
myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyListboxTag.java
myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyMenuTag.java
myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectOneListboxTag.java
myfaces/trunk/src/share/org/apache/myfaces/component/DisplayValueOnlyCapable.java
myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGridRendererBase.java
myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGroupRendererBase.java
myfaces/trunk/tlds/entities/standard_panel_grid_attributes.xml
myfaces/trunk/tlds/entities/standard_select_boolean_checkbox_attributes.xml
myfaces/trunk/tlds/entities/standard_select_many_listbox_attributes.xml
myfaces/trunk/tlds/entities/standard_select_many_menu_attributes.xml
myfaces/trunk/tlds/entities/standard_select_one_listbox_attributes.xml
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.java Mon May 16 14:48:17 2005
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.component.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.UserRoleUtils;
+import org.apache.myfaces.component.DisplayValueOnlyCapable;
+import org.apache.myfaces.component.html.util.HtmlComponentUtils;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170214 $ $Date: 2005-05-15 13:24:37 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlPanelGrid
+ extends javax.faces.component.html.HtmlPanelGrid
+ implements UserRoleAware, DisplayValueOnlyCapable
+{
+ public String getClientId(FacesContext context)
+ {
+ String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
+ if (clientId == null)
+ {
+ clientId = super.getClientId(context);
+ }
+
+ return clientId;
+ }
+
+ //private static final Log log = LogFactory.getLog(HtmlPanelGroup.class);
+
+ //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlPanelGrid";
+ private static final boolean DEFAULT_DISPLAYVALUEONLY = false;
+
+ private String _enabledOnUserRole = null;
+ private String _visibleOnUserRole = null;
+ private Boolean _displayValueOnly = null;
+ private String _displayValueOnlyStyle = null;
+ private String _displayValueOnlyStyleClass = null;
+
+ public HtmlPanelGrid()
+ {
+ }
+
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public String getEnabledOnUserRole()
+ {
+ if (_enabledOnUserRole != null) return _enabledOnUserRole;
+ ValueBinding vb = getValueBinding("enabledOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public String getVisibleOnUserRole()
+ {
+ if (_visibleOnUserRole != null) return _visibleOnUserRole;
+ ValueBinding vb = getValueBinding("visibleOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public boolean isDisplayValueOnly() {
+ if (_displayValueOnly != null) return _displayValueOnly.booleanValue();
+ ValueBinding vb = getValueBinding("displayValueOnly");
+ Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_DISPLAYVALUEONLY;
+ }
+
+ public void setDisplayValueOnly(boolean displayValueOnly) {
+ _displayValueOnly = Boolean.valueOf(displayValueOnly);
+ }
+
+ public String getDisplayValueOnlyStyle() {
+ if (_displayValueOnlyStyle != null) return _displayValueOnlyStyle;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyle");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle) {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public String getDisplayValueOnlyStyleClass() {
+ if (_displayValueOnlyStyleClass != null) return _displayValueOnlyStyleClass;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyleClass");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass) {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+
+
+ public boolean isRendered()
+ {
+ if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
+ return super.isRendered();
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ Object values[] = new Object[6];
+ values[0] = super.saveState(context);
+ values[1] = _enabledOnUserRole;
+ values[2] = _visibleOnUserRole;
+ values[3] = _displayValueOnly;
+ values[4] = _displayValueOnlyStyle;
+ values[5] = _displayValueOnlyStyleClass;
+ return ((Object) (values));
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ _enabledOnUserRole = (String)values[1];
+ _visibleOnUserRole = (String)values[2];
+ _displayValueOnly = (Boolean)values[3];
+ _displayValueOnlyStyle = (String)values[4];
+ _displayValueOnlyStyleClass = (String)values[5];
+ }
+ //------------------ GENERATED CODE END ---------------------------------------
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.xml (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlPanelGrid.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE component PUBLIC
+ "-//MyFaces//DTD MyFaces component def 1.0//EN"
+ "http://myfaces.apache.org/dtd/Component.dtd">
+<component generateUserRoleMethods="true" >
+ <component-class>org.apache.myfaces.component.html.ext.HtmlPanelGrid</component-class>
+ <base-class>javax.faces.component.html.HtmlPanelGrid</base-class>
+ <component-type>org.apache.myfaces.HtmlPanelGrid</component-type>
+ <field>
+ <name>enabledOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>visibleOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnly</name>
+ <type>boolean</type>
+ <default-value>false</default-value>
+ </field>
+ <field>
+ <name>displayValueOnlyStyle</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnlyStyleClass</name>
+ <type>java.lang.String</type>
+ </field>
+</component>
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java Mon May 16 14:48:17 2005
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.component.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.UserRoleUtils;
+import org.apache.myfaces.component.DisplayValueOnlyCapable;
+import org.apache.myfaces.component.html.util.HtmlComponentUtils;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170213 $ $Date: 2005-05-15 13:22:56 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlSelectBooleanCheckbox
+ extends javax.faces.component.html.HtmlSelectBooleanCheckbox
+ implements UserRoleAware, DisplayValueOnlyCapable
+{
+ public String getClientId(FacesContext context)
+ {
+ String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
+ if (clientId == null)
+ {
+ clientId = super.getClientId(context);
+ }
+
+ return clientId;
+ }
+
+ //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlSelectBooleanCheckbox";
+ private static final boolean DEFAULT_DISPLAYVALUEONLY = false;
+
+ private String _enabledOnUserRole = null;
+ private String _visibleOnUserRole = null;
+ private Boolean _displayValueOnly = null;
+ private String _displayValueOnlyStyle = null;
+ private String _displayValueOnlyStyleClass = null;
+
+ public HtmlSelectBooleanCheckbox()
+ {
+ }
+
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public String getEnabledOnUserRole()
+ {
+ if (_enabledOnUserRole != null) return _enabledOnUserRole;
+ ValueBinding vb = getValueBinding("enabledOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public String getVisibleOnUserRole()
+ {
+ if (_visibleOnUserRole != null) return _visibleOnUserRole;
+ ValueBinding vb = getValueBinding("visibleOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public boolean isDisplayValueOnly() {
+ if (_displayValueOnly != null) return _displayValueOnly.booleanValue();
+ ValueBinding vb = getValueBinding("displayValueOnly");
+ Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_DISPLAYVALUEONLY;
+ }
+
+ public void setDisplayValueOnly(boolean displayValueOnly) {
+ _displayValueOnly = Boolean.valueOf(displayValueOnly);
+ }
+
+ public String getDisplayValueOnlyStyle() {
+ if (_displayValueOnlyStyle != null) return _displayValueOnlyStyle;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyle");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle) {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public String getDisplayValueOnlyStyleClass() {
+ if (_displayValueOnlyStyleClass != null) return _displayValueOnlyStyleClass;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyleClass");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass) {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+
+
+ public boolean isRendered()
+ {
+ if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
+ return super.isRendered();
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ Object values[] = new Object[6];
+ values[0] = super.saveState(context);
+ values[1] = _enabledOnUserRole;
+ values[2] = _visibleOnUserRole;
+ values[3] = _displayValueOnly;
+ values[4] = _displayValueOnlyStyle;
+ values[5] = _displayValueOnlyStyleClass;
+ return ((Object) (values));
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ _enabledOnUserRole = (String)values[1];
+ _visibleOnUserRole = (String)values[2];
+ _displayValueOnly = (Boolean)values[3];
+ _displayValueOnlyStyle = (String)values[4];
+ _displayValueOnlyStyleClass = (String)values[5];
+ }
+ //------------------ GENERATED CODE END ---------------------------------------
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.xml (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE component PUBLIC
+ "-//MyFaces//DTD MyFaces component def 1.0//EN"
+ "http://myfaces.apache.org/dtd/Component.dtd">
+<component generateStateMethods="true" generateUserRoleMethods="true" >
+ <component-class>org.apache.myfaces.component.html.ext.HtmlSelectBooleanCheckbox</component-class>
+ <base-class>javax.faces.component.html.HtmlSelectBooleanCheckbox</base-class>
+ <component-type>org.apache.myfaces.HtmlSelectBooleanCheckbox</component-type>
+ <field>
+ <name>enabledOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>visibleOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnly</name>
+ <type>boolean</type>
+ <default-value>false</default-value>
+ </field>
+ <field>
+ <name>displayValueOnlyStyle</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnlyStyleClass</name>
+ <type>java.lang.String</type>
+ </field>
+</component>
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.java Mon May 16 14:48:17 2005
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.component.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.UserRoleUtils;
+import org.apache.myfaces.component.DisplayValueOnlyCapable;
+import org.apache.myfaces.component.html.util.HtmlComponentUtils;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170213 $ $Date: 2005-05-15 13:22:56 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlSelectManyListbox
+ extends javax.faces.component.html.HtmlSelectManyListbox
+ implements UserRoleAware, DisplayValueOnlyCapable
+{
+ public String getClientId(FacesContext context)
+ {
+ String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
+ if (clientId == null)
+ {
+ clientId = super.getClientId(context);
+ }
+
+ return clientId;
+ }
+
+ //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlSelectManyListbox";
+ private static final boolean DEFAULT_DISPLAYVALUEONLY = false;
+
+ private String _enabledOnUserRole = null;
+ private String _visibleOnUserRole = null;
+ private Boolean _displayValueOnly = null;
+ private String _displayValueOnlyStyle = null;
+ private String _displayValueOnlyStyleClass = null;
+
+ public HtmlSelectManyListbox()
+ {
+ }
+
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public String getEnabledOnUserRole()
+ {
+ if (_enabledOnUserRole != null) return _enabledOnUserRole;
+ ValueBinding vb = getValueBinding("enabledOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public String getVisibleOnUserRole()
+ {
+ if (_visibleOnUserRole != null) return _visibleOnUserRole;
+ ValueBinding vb = getValueBinding("visibleOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public boolean isDisplayValueOnly() {
+ if (_displayValueOnly != null) return _displayValueOnly.booleanValue();
+ ValueBinding vb = getValueBinding("displayValueOnly");
+ Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_DISPLAYVALUEONLY;
+ }
+
+ public void setDisplayValueOnly(boolean displayValueOnly) {
+ _displayValueOnly = Boolean.valueOf(displayValueOnly);
+ }
+
+ public String getDisplayValueOnlyStyle() {
+ if (_displayValueOnlyStyle != null) return _displayValueOnlyStyle;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyle");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle) {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public String getDisplayValueOnlyStyleClass() {
+ if (_displayValueOnlyStyleClass != null) return _displayValueOnlyStyleClass;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyleClass");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass) {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+
+ public boolean isRendered()
+ {
+ if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
+ return super.isRendered();
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ Object values[] = new Object[6];
+ values[0] = super.saveState(context);
+ values[1] = _enabledOnUserRole;
+ values[2] = _visibleOnUserRole;
+ values[3] = _displayValueOnly;
+ values[4] = _displayValueOnlyStyle;
+ values[5] = _displayValueOnlyStyleClass;
+ return ((Object) (values));
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ _enabledOnUserRole = (String)values[1];
+ _visibleOnUserRole = (String)values[2];
+ _displayValueOnly = (Boolean)values[3];
+ _displayValueOnlyStyle = (String)values[4];
+ _displayValueOnlyStyleClass = (String)values[5];
+ }
+ //------------------ GENERATED CODE END ---------------------------------------
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.xml (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyListbox.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE component PUBLIC
+ "-//MyFaces//DTD MyFaces component def 1.0//EN"
+ "http://myfaces.apache.org/dtd/Component.dtd">
+<component generateStateMethods="true" generateUserRoleMethods="true" >
+ <component-class>org.apache.myfaces.component.html.ext.HtmlSelectManyListbox</component-class>
+ <base-class>javax.faces.component.html.HtmlSelectManyListbox</base-class>
+ <component-type>org.apache.myfaces.HtmlSelectManyListbox</component-type>
+ <field>
+ <name>enabledOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>visibleOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnly</name>
+ <type>boolean</type>
+ <default-value>false</default-value>
+ </field>
+ <field>
+ <name>displayValueOnlyStyle</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnlyStyleClass</name>
+ <type>java.lang.String</type>
+ </field>
+</component>
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.java Mon May 16 14:48:17 2005
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.component.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.UserRoleUtils;
+import org.apache.myfaces.component.DisplayValueOnlyCapable;
+import org.apache.myfaces.component.html.util.HtmlComponentUtils;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170213 $ $Date: 2005-05-15 13:22:56 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlSelectManyMenu
+ extends javax.faces.component.html.HtmlSelectManyMenu
+ implements UserRoleAware, DisplayValueOnlyCapable
+{
+ public String getClientId(FacesContext context)
+ {
+ String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
+ if (clientId == null)
+ {
+ clientId = super.getClientId(context);
+ }
+
+ return clientId;
+ }
+
+ //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlSelectManyMenu";
+ private static final boolean DEFAULT_DISPLAYVALUEONLY = false;
+
+ private String _enabledOnUserRole = null;
+ private String _visibleOnUserRole = null;
+ private Boolean _displayValueOnly = null;
+ private String _displayValueOnlyStyle = null;
+ private String _displayValueOnlyStyleClass = null;
+
+ public HtmlSelectManyMenu()
+ {
+ }
+
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public String getEnabledOnUserRole()
+ {
+ if (_enabledOnUserRole != null) return _enabledOnUserRole;
+ ValueBinding vb = getValueBinding("enabledOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public String getVisibleOnUserRole()
+ {
+ if (_visibleOnUserRole != null) return _visibleOnUserRole;
+ ValueBinding vb = getValueBinding("visibleOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public boolean isDisplayValueOnly() {
+ if (_displayValueOnly != null) return _displayValueOnly.booleanValue();
+ ValueBinding vb = getValueBinding("displayValueOnly");
+ Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_DISPLAYVALUEONLY;
+ }
+
+ public void setDisplayValueOnly(boolean displayValueOnly) {
+ _displayValueOnly = Boolean.valueOf(displayValueOnly);
+ }
+
+ public String getDisplayValueOnlyStyle() {
+ if (_displayValueOnlyStyle != null) return _displayValueOnlyStyle;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyle");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle) {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public String getDisplayValueOnlyStyleClass() {
+ if (_displayValueOnlyStyleClass != null) return _displayValueOnlyStyleClass;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyleClass");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass) {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+
+ public boolean isRendered()
+ {
+ if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
+ return super.isRendered();
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ Object values[] = new Object[6];
+ values[0] = super.saveState(context);
+ values[1] = _enabledOnUserRole;
+ values[2] = _visibleOnUserRole;
+ values[3] = _displayValueOnly;
+ values[4] = _displayValueOnlyStyle;
+ values[5] = _displayValueOnlyStyleClass;
+ return ((Object) (values));
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ _enabledOnUserRole = (String)values[1];
+ _visibleOnUserRole = (String)values[2];
+ _displayValueOnly = (Boolean)values[3];
+ _displayValueOnlyStyle = (String)values[4];
+ _displayValueOnlyStyleClass = (String)values[5];
+ }
+ //------------------ GENERATED CODE END ---------------------------------------
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.xml (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectManyMenu.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE component PUBLIC
+ "-//MyFaces//DTD MyFaces component def 1.0//EN"
+ "http://myfaces.apache.org/dtd/Component.dtd">
+<component generateStateMethods="true" generateUserRoleMethods="true" >
+ <component-class>org.apache.myfaces.component.html.ext.HtmlSelectManyMenu</component-class>
+ <base-class>javax.faces.component.html.HtmlSelectManyMenu</base-class>
+ <component-type>org.apache.myfaces.HtmlSelectManyMenu</component-type>
+ <field>
+ <name>enabledOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>visibleOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnly</name>
+ <type>boolean</type>
+ <default-value>false</default-value>
+ </field>
+ <field>
+ <name>displayValueOnlyStyle</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnlyStyleClass</name>
+ <type>java.lang.String</type>
+ </field>
+</component>
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.java Mon May 16 14:48:17 2005
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.component.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.UserRoleUtils;
+import org.apache.myfaces.component.DisplayValueOnlyCapable;
+import org.apache.myfaces.component.html.util.HtmlComponentUtils;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170213 $ $Date: 2005-05-15 13:22:56 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlSelectOneListbox
+ extends javax.faces.component.html.HtmlSelectOneListbox
+ implements UserRoleAware, DisplayValueOnlyCapable
+{
+ public String getClientId(FacesContext context)
+ {
+ String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
+ if (clientId == null)
+ {
+ clientId = super.getClientId(context);
+ }
+
+ return clientId;
+ }
+
+ //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlSelectOneListbox";
+ private static final boolean DEFAULT_DISPLAYVALUEONLY = false;
+
+ private String _enabledOnUserRole = null;
+ private String _visibleOnUserRole = null;
+ private Boolean _displayValueOnly = null;
+ private String _displayValueOnlyStyle = null;
+ private String _displayValueOnlyStyleClass = null;
+
+ public HtmlSelectOneListbox()
+ {
+ }
+
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public String getEnabledOnUserRole()
+ {
+ if (_enabledOnUserRole != null) return _enabledOnUserRole;
+ ValueBinding vb = getValueBinding("enabledOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public String getVisibleOnUserRole()
+ {
+ if (_visibleOnUserRole != null) return _visibleOnUserRole;
+ ValueBinding vb = getValueBinding("visibleOnUserRole");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public boolean isDisplayValueOnly() {
+ if (_displayValueOnly != null) return _displayValueOnly.booleanValue();
+ ValueBinding vb = getValueBinding("displayValueOnly");
+ Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_DISPLAYVALUEONLY;
+ }
+
+ public void setDisplayValueOnly(boolean displayValueOnly) {
+ _displayValueOnly = Boolean.valueOf(displayValueOnly);
+ }
+
+ public String getDisplayValueOnlyStyle() {
+ if (_displayValueOnlyStyle != null) return _displayValueOnlyStyle;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyle");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle) {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public String getDisplayValueOnlyStyleClass() {
+ if (_displayValueOnlyStyleClass != null) return _displayValueOnlyStyleClass;
+ ValueBinding vb = getValueBinding("displayValueOnlyStyleClass");
+ return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass) {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+
+ public boolean isRendered()
+ {
+ if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
+ return super.isRendered();
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ Object values[] = new Object[6];
+ values[0] = super.saveState(context);
+ values[1] = _enabledOnUserRole;
+ values[2] = _visibleOnUserRole;
+ values[3] = _displayValueOnly;
+ values[4] = _displayValueOnlyStyle;
+ values[5] = _displayValueOnlyStyleClass;
+ return ((Object) (values));
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ _enabledOnUserRole = (String)values[1];
+ _visibleOnUserRole = (String)values[2];
+ _displayValueOnly = (Boolean)values[3];
+ _displayValueOnlyStyle = (String)values[4];
+ _displayValueOnlyStyleClass = (String)values[5];
+ }
+ //------------------ GENERATED CODE END ---------------------------------------
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.xml (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/component/html/ext/HtmlSelectOneListbox.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE component PUBLIC
+ "-//MyFaces//DTD MyFaces component def 1.0//EN"
+ "http://myfaces.apache.org/dtd/Component.dtd">
+<component generateStateMethods="true" generateUserRoleMethods="true" >
+ <component-class>org.apache.myfaces.component.html.ext.HtmlSelectOneListbox</component-class>
+ <base-class>javax.faces.component.html.HtmlSelectOneListbox</base-class>
+ <component-type>org.apache.myfaces.HtmlSelectOneListbox</component-type>
+ <field>
+ <name>enabledOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>visibleOnUserRole</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnly</name>
+ <type>boolean</type>
+ <default-value>false</default-value>
+ </field>
+ <field>
+ <name>displayValueOnlyStyle</name>
+ <type>java.lang.String</type>
+ </field>
+ <field>
+ <name>displayValueOnlyStyleClass</name>
+ <type>java.lang.String</type>
+ </field>
+</component>
Added: myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGridRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGridRenderer.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGridRenderer.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGridRenderer.java Mon May 16 14:48:17 2005
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.renderkit.html.ext;
+
+import org.apache.myfaces.renderkit.html.HtmlGridRendererBase;
+
+/**
+ * X-CHECKED: tlddoc h:panelGrid 1.0 final
+ *
+ * @author Martin Marinschek (latest modification by $Author: grantsmith $)
+ * @version $Revision: 169655 $ $Date: 2005-05-11 18:45:06 +0200 (Wed, 11 May 2005) $
+ */
+public class HtmlGridRenderer
+ extends HtmlGridRendererBase
+{
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java Mon May 16 14:48:17 2005
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.renderkit.html.ext;
+
+import org.apache.myfaces.renderkit.html.HtmlGroupRendererBase;
+
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 167446 $ $Date: 2004-12-23 13:03:09Z $
+ */
+public class HtmlGroupRenderer
+ extends HtmlGroupRendererBase
+{
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java Mon May 16 14:48:17 2005
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.taglib.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.html.ext.HtmlPanelGrid;
+import org.apache.myfaces.taglib.html.HtmlPanelGridTagBase;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170213 $ $Date: 2005-05-15 13:22:56 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlPanelGridTag
+ extends HtmlPanelGridTagBase
+{
+ public String getComponentType()
+ {
+ return HtmlPanelGrid.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return "org.apache.myfaces.Grid";
+ }
+
+ private String _enabledOnUserRole;
+ private String _visibleOnUserRole;
+
+ private String _displayValueOnly;
+ private String _displayValueOnlyStyle;
+ private String _displayValueOnlyStyleClass;
+
+ public void release() {
+ super.release();
+ _enabledOnUserRole=null;
+ _visibleOnUserRole=null;
+ }
+
+ protected void setProperties(UIComponent component)
+ {
+ super.setProperties(component);
+ setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
+ setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
+
+ setBooleanProperty(component, "displayValueOnly", _displayValueOnly);
+ setStringProperty(component, "displayValueOnlyStyle", _displayValueOnlyStyle);
+ setStringProperty(component, "displayValueOnlyStyleClass", _displayValueOnlyStyleClass);
+ }
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public void setDisplayValueOnly(String displayValueOnly)
+ {
+ _displayValueOnly = displayValueOnly;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
+ {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
+ {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectBooleanCheckboxTag.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectBooleanCheckboxTag.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectBooleanCheckboxTag.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectBooleanCheckboxTag.java Mon May 16 14:48:17 2005
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.taglib.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.html.ext.HtmlSelectBooleanCheckbox;
+import org.apache.myfaces.taglib.html.HtmlSelectBooleanCheckboxTagBase;
+
+import javax.faces.component.UIComponent;
+
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170212 $ $Date: 2005-05-15 12:58:15 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlSelectBooleanCheckboxTag
+ extends HtmlSelectBooleanCheckboxTagBase
+{
+ public String getComponentType()
+ {
+ return HtmlSelectBooleanCheckbox.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return "org.apache.myfaces.Checkbox";
+ }
+
+ private String _enabledOnUserRole;
+ private String _visibleOnUserRole;
+
+ private String _displayValueOnly;
+ private String _displayValueOnlyStyle;
+ private String _displayValueOnlyStyleClass;
+
+ public void release() {
+ super.release();
+ _enabledOnUserRole=null;
+ _visibleOnUserRole=null;
+
+ _displayValueOnly=null;
+ _displayValueOnlyStyle=null;
+ _displayValueOnlyStyleClass=null;
+ }
+
+ protected void setProperties(UIComponent component)
+ {
+ super.setProperties(component);
+ setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
+ setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
+
+ setBooleanProperty(component, "displayValueOnly", _displayValueOnly);
+ setStringProperty(component, "displayValueOnlyStyle", _displayValueOnlyStyle);
+ setStringProperty(component, "displayValueOnlyStyleClass", _displayValueOnlyStyleClass);
+ }
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public void setDisplayValueOnly(String displayValueOnly)
+ {
+ _displayValueOnly = displayValueOnly;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
+ {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
+ {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyListboxTag.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyListboxTag.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyListboxTag.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyListboxTag.java Mon May 16 14:48:17 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.taglib.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.html.ext.HtmlSelectManyListbox;
+import org.apache.myfaces.taglib.html.HtmlSelectListboxTagBase;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170212 $ $Date: 2005-05-15 12:58:15 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlSelectManyListboxTag
+ extends HtmlSelectListboxTagBase
+{
+ public String getComponentType()
+ {
+ return HtmlSelectManyListbox.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return "org.apache.myfaces.Listbox";
+ }
+
+ private String _enabledOnUserRole;
+ private String _visibleOnUserRole;
+
+ private String _displayValueOnly;
+ private String _displayValueOnlyStyle;
+ private String _displayValueOnlyStyleClass;
+
+ public void release() {
+ super.release();
+ _enabledOnUserRole=null;
+ _visibleOnUserRole=null;
+
+ _displayValueOnly=null;
+ _displayValueOnlyStyle=null;
+ _displayValueOnlyStyleClass=null;
+ }
+
+ protected void setProperties(UIComponent component)
+ {
+ super.setProperties(component);
+ setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
+ setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
+
+ setBooleanProperty(component, "displayValueOnly", _displayValueOnly);
+ setStringProperty(component, "displayValueOnlyStyle", _displayValueOnlyStyle);
+ setStringProperty(component, "displayValueOnlyStyleClass", _displayValueOnlyStyleClass);
+ }
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public void setDisplayValueOnly(String displayValueOnly)
+ {
+ _displayValueOnly = displayValueOnly;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
+ {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
+ {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyMenuTag.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyMenuTag.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyMenuTag.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectManyMenuTag.java Mon May 16 14:48:17 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.taglib.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.html.ext.HtmlSelectManyMenu;
+import org.apache.myfaces.taglib.html.HtmlSelectMenuTagBase;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170212 $ $Date: 2005-05-15 12:58:15 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlSelectManyMenuTag
+ extends HtmlSelectMenuTagBase
+{
+ public String getComponentType()
+ {
+ return HtmlSelectManyMenu.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return "org.apache.myfaces.Menu";
+ }
+
+ private String _enabledOnUserRole;
+ private String _visibleOnUserRole;
+
+ private String _displayValueOnly;
+ private String _displayValueOnlyStyle;
+ private String _displayValueOnlyStyleClass;
+
+ public void release() {
+ super.release();
+ _enabledOnUserRole=null;
+ _visibleOnUserRole=null;
+
+ _displayValueOnly=null;
+ _displayValueOnlyStyle=null;
+ _displayValueOnlyStyleClass=null;
+ }
+
+ protected void setProperties(UIComponent component)
+ {
+ super.setProperties(component);
+ setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
+ setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
+
+ setBooleanProperty(component, "displayValueOnly", _displayValueOnly);
+ setStringProperty(component, "displayValueOnlyStyle", _displayValueOnlyStyle);
+ setStringProperty(component, "displayValueOnlyStyleClass", _displayValueOnlyStyleClass);
+ }
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public void setDisplayValueOnly(String displayValueOnly)
+ {
+ _displayValueOnly = displayValueOnly;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
+ {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
+ {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+}
Added: myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectOneListboxTag.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectOneListboxTag.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectOneListboxTag.java (added)
+++ myfaces/trunk/src/components/org/apache/myfaces/taglib/html/ext/HtmlSelectOneListboxTag.java Mon May 16 14:48:17 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.taglib.html.ext;
+
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.html.ext.HtmlSelectOneListbox;
+import org.apache.myfaces.taglib.html.HtmlSelectListboxTagBase;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
+ * @version $Revision: 170212 $ $Date: 2005-05-15 12:58:15 +0200 (Sun, 15 May 2005) $
+ */
+public class HtmlSelectOneListboxTag
+ extends HtmlSelectListboxTagBase
+{
+ public String getComponentType()
+ {
+ return HtmlSelectOneListbox.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return "org.apache.myfaces.Listbox";
+ }
+
+ private String _enabledOnUserRole;
+ private String _visibleOnUserRole;
+
+ private String _displayValueOnly;
+ private String _displayValueOnlyStyle;
+ private String _displayValueOnlyStyleClass;
+
+ public void release() {
+ super.release();
+ _enabledOnUserRole=null;
+ _visibleOnUserRole=null;
+
+ _displayValueOnly=null;
+ _displayValueOnlyStyle=null;
+ _displayValueOnlyStyleClass=null;
+ }
+
+ protected void setProperties(UIComponent component)
+ {
+ super.setProperties(component);
+ setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
+ setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
+
+ setBooleanProperty(component, "displayValueOnly", _displayValueOnly);
+ setStringProperty(component, "displayValueOnlyStyle", _displayValueOnlyStyle);
+ setStringProperty(component, "displayValueOnlyStyleClass", _displayValueOnlyStyleClass);
+ }
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public void setDisplayValueOnly(String displayValueOnly)
+ {
+ _displayValueOnly = displayValueOnly;
+ }
+
+ public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
+ {
+ _displayValueOnlyStyle = displayValueOnlyStyle;
+ }
+
+ public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
+ {
+ _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
+ }
+}
Added: myfaces/trunk/src/share/org/apache/myfaces/component/DisplayValueOnlyCapable.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/share/org/apache/myfaces/component/DisplayValueOnlyCapable.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/share/org/apache/myfaces/component/DisplayValueOnlyCapable.java (added)
+++ myfaces/trunk/src/share/org/apache/myfaces/component/DisplayValueOnlyCapable.java Mon May 16 14:48:17 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.component;
+
+/**
+ * Behavioral interface.
+ * By default, displayValueOnly is false, and the components have the default behaviour.
+ * When displayValueOnly is true, the renderer should not render any input widget.
+ * Only the text corresponding to the component's value should be rendered instead.
+ *
+ * @author Sylvain Vieujot & Martin Marinschek (latest modification by $Author: svieujot $)
+ * @version $Revision: 169739 $ $Date: 2005-05-12 02:45:14 +0200 (Thu, 12 May 2005) $
+ */
+public interface DisplayValueOnlyCapable
+{
+ public boolean isDisplayValueOnly();
+ public void setDisplayValueOnly(boolean displayValueOnly);
+
+ public String getDisplayValueOnlyStyle();
+ public void setDisplayValueOnlyStyle(String style);
+
+ public String getDisplayValueOnlyStyleClass();
+ public void setDisplayValueOnlyStyleClass(String styleClass);
+}
Added: myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGridRendererBase.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGridRendererBase.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGridRendererBase.java (added)
+++ myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGridRendererBase.java Mon May 16 14:48:17 2005
@@ -0,0 +1,248 @@
+/**
+ * Copyright 2004 by Irian Marinschek & Spiegl Software OEG
+ */
+package org.apache.myfaces.renderkit.html;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.renderkit.RendererUtils;
+import org.apache.myfaces.renderkit.JSFAttr;
+import org.apache.myfaces.util.ArrayUtils;
+import org.apache.myfaces.util.StringUtils;
+
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIPanel;
+import javax.faces.component.html.HtmlPanelGrid;
+import java.io.IOException;
+import java.util.Iterator;
+
+/**
+ * @author Martin Marinschek
+ * @version $Revision: $ $Date: $
+ * <p/>
+ * $Log: $
+ */
+public class HtmlGridRendererBase
+{
+ private static final Log log = LogFactory.getLog(HtmlGridRendererBase.class);
+
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ public void encodeBegin(FacesContext facesContext, UIComponent component)
+ throws IOException
+ {
+ // all work done in encodeEnd()
+ }
+
+ public void encodeChildren(FacesContext context, UIComponent component)
+ throws IOException
+ {
+ // all work done in encodeEnd()
+ }
+
+ public void encodeEnd(FacesContext facesContext, UIComponent component)
+ throws IOException
+ {
+ RendererUtils.checkParamValidity(facesContext, component, UIPanel.class);
+
+ int columns;
+ if (component instanceof HtmlPanelGrid)
+ {
+ columns = ((HtmlPanelGrid)component).getColumns();
+ }
+ else
+ {
+ Integer i = (Integer)component.getAttributes().get(JSFAttr.COLUMNS_ATTR);
+ columns = i != null ? i.intValue() : 0;
+ }
+
+ if (columns <= 0)
+ {
+ if (log.isErrorEnabled())
+ {
+ log.error("Wrong columns attribute for PanelGrid " + component.getClientId(facesContext) + ": " + columns);
+ }
+ columns = 1;
+ }
+
+ ResponseWriter writer = facesContext.getResponseWriter();
+ writer.startElement(HTML.TABLE_ELEM, component);
+ HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
+ HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
+
+ writer.flush();
+
+ renderHeaderOrFooter(facesContext, writer, component, columns, true); //Header facet
+
+ renderChildren(facesContext, writer, component, columns);
+
+ renderHeaderOrFooter(facesContext, writer, component, columns, false); //Footer facet
+
+ writer.endElement(HTML.TABLE_ELEM);
+ }
+
+
+ private void renderHeaderOrFooter(FacesContext context,
+ ResponseWriter writer,
+ UIComponent component,
+ int columns,
+ boolean header)
+ throws IOException
+ {
+ UIComponent facet = component.getFacet(header ? "header" : "footer");
+ if (facet == null) return;
+
+ HtmlRendererUtils.writePrettyLineSeparator(context);
+ writer.startElement(header ? HTML.THEAD_ELEM : HTML.TFOOT_ELEM, component);
+ writer.startElement(HTML.TR_ELEM, component);
+ writer.startElement(header ? HTML.TH_ELEM : HTML.TD_ELEM, component);
+
+ String styleClass = (component instanceof HtmlPanelGrid)
+ ? (header ?
+ ((HtmlPanelGrid)component).getHeaderClass() :
+ ((HtmlPanelGrid)component).getFooterClass())
+ : (header ?
+ (String)component.getAttributes().get(JSFAttr.HEADER_CLASS_ATTR) :
+ (String)component.getAttributes().get(JSFAttr.FOOTER_CLASS_ATTR));
+ if (styleClass != null)
+ {
+ writer.writeAttribute(HTML.CLASS_ATTR, styleClass,
+ header ? JSFAttr.HEADER_CLASS_ATTR : JSFAttr.FOOTER_CLASS_ATTR);
+ }
+
+ if (header)
+ {
+ writer.writeAttribute(HTML.SCOPE_ATTR, HTML.SCOPE_COLGROUP_VALUE, null);
+ }
+
+ writer.writeAttribute(HTML.COLSPAN_ATTR, Integer.toString(columns), null);
+
+ HtmlRendererUtils.writePrettyLineSeparator(context);
+ RendererUtils.renderChild(context, facet);
+
+ HtmlRendererUtils.writePrettyLineSeparator(context);
+ writer.endElement(header ? HTML.TH_ELEM : HTML.TD_ELEM);
+ writer.endElement(HTML.TR_ELEM);
+ writer.endElement(header ? HTML.THEAD_ELEM : HTML.TFOOT_ELEM);
+ }
+
+
+ private void renderChildren(FacesContext context,
+ ResponseWriter writer,
+ UIComponent component,
+ int columns)
+ throws IOException
+ {
+ try
+ {
+ writer.startElement(HTML.TBODY_ELEM, component);
+
+ String columnClasses;
+ String rowClasses;
+ if (component instanceof HtmlPanelGrid)
+ {
+ columnClasses = ((HtmlPanelGrid)component).getColumnClasses();
+ rowClasses = ((HtmlPanelGrid)component).getRowClasses();
+ }
+ else
+ {
+ columnClasses = (String)component.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR);
+ rowClasses = (String)component.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR);
+ }
+
+ String[] columnClassesArray = (columnClasses == null)
+ ? ArrayUtils.EMPTY_STRING_ARRAY
+ : StringUtils.trim(StringUtils.splitShortString(columnClasses, ','));
+ int columnClassesCount = columnClassesArray.length;
+
+ String[] rowClassesArray = (rowClasses == null)
+ ? ArrayUtils.EMPTY_STRING_ARRAY
+ : StringUtils.trim(StringUtils.splitShortString(rowClasses, ','));
+ int rowClassesCount = rowClassesArray.length;
+
+ int childCount = component.getChildCount();
+ if (childCount > 0)
+ {
+ int columnIndex = 0;
+ int rowClassIndex = 0;
+ boolean rowStarted = false;
+ for (Iterator it = component.getChildren().iterator(); it.hasNext(); )
+ {
+ UIComponent child = (UIComponent)it.next();
+ if (child.isRendered())
+ {
+ if (columnIndex == 0)
+ {
+ //start of new/next row
+ if (rowStarted)
+ {
+ //do we have to close the last row?
+ writer.endElement(HTML.TR_ELEM);
+ HtmlRendererUtils.writePrettyLineSeparator(context);
+ }
+ writer.startElement(HTML.TR_ELEM, component);
+ if (rowClassIndex < rowClassesCount) {
+ writer.writeAttribute(HTML.CLASS_ATTR, rowClassesArray[rowClassIndex], null);
+ }
+ rowStarted = true;
+ rowClassIndex++;
+ if (rowClassIndex == rowClassesCount) {
+ rowClassIndex = 0;
+ }
+ }
+
+ writer.startElement(HTML.TD_ELEM, component);
+ if (columnIndex < columnClassesCount)
+ {
+ writer.writeAttribute(HTML.CLASS_ATTR, columnClassesArray[columnIndex], null);
+ }
+ RendererUtils.renderChild(context, child);
+ writer.endElement(HTML.TD_ELEM);
+
+ columnIndex++;
+ if (columnIndex >= columns) {
+ columnIndex = 0;
+ }
+ }
+ }
+
+ if (rowStarted)
+ {
+ if (columnIndex > 0)
+ {
+ if (log.isWarnEnabled()) log.warn("PanelGrid " + component.getClientId(context) + " has not enough children. Child count should be a multiple of the columns attribute.");
+ //Render empty columns, so that table is correct
+ for ( ; columnIndex < columns; columnIndex++)
+ {
+ writer.startElement(HTML.TD_ELEM, component);
+ if (columnIndex < columnClassesCount)
+ {
+ writer.writeAttribute(HTML.CLASS_ATTR, columnClassesArray[columnIndex], null);
+ }
+ writer.endElement(HTML.TD_ELEM);
+ }
+ }
+ writer.endElement(HTML.TR_ELEM);
+ HtmlRendererUtils.writePrettyLineSeparator(context);
+ }
+ }
+
+ writer.endElement(HTML.TBODY_ELEM);
+ }
+ catch(IOException ex)
+ {
+ throw ex;
+ }
+ catch(RuntimeException ex2)
+ {
+ log.error("Exception while rendering children of panel-grid.",ex2);
+ throw ex2;
+ }
+ }
+
+}
Added: myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGroupRendererBase.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGroupRendererBase.java?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGroupRendererBase.java (added)
+++ myfaces/trunk/src/share/org/apache/myfaces/renderkit/html/HtmlGroupRendererBase.java Mon May 16 14:48:17 2005
@@ -0,0 +1,68 @@
+/**
+ * Copyright 2004 by Irian Marinschek & Spiegl Software OEG
+ */
+package org.apache.myfaces.renderkit.html;
+
+import org.apache.myfaces.renderkit.RendererUtils;
+
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import java.io.IOException;
+
+/**
+ * @author Martin Marinschek
+ * @version $Revision: $ $Date: $
+ * <p/>
+ * $Log: $
+ */
+public class HtmlGroupRendererBase
+{
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ public void encodeBegin(FacesContext context, UIComponent component)
+ throws IOException
+ {
+ }
+
+ public void encodeChildren(FacesContext context, UIComponent component)
+ throws IOException
+ {
+ }
+
+ public void encodeEnd(FacesContext context, UIComponent component)
+ throws IOException
+ {
+ ResponseWriter writer = context.getResponseWriter();
+ boolean span = false;
+
+ if(component.getId()!=null && !component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
+ {
+ span = true;
+
+ writer.startElement(HTML.SPAN_ELEM, component);
+
+ HtmlRendererUtils.writeIdIfNecessary(writer, component, context);
+
+ HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+ }
+ else
+ {
+ span=HtmlRendererUtils.renderHTMLAttributesWithOptionalStartElement(writer,
+ component,
+ HTML.SPAN_ELEM,
+ HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+ }
+
+ RendererUtils.renderChildren(context, component);
+ if (span)
+ {
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+ }
+
+}
Added: myfaces/trunk/tlds/entities/standard_panel_grid_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/tlds/entities/standard_panel_grid_attributes.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/tlds/entities/standard_panel_grid_attributes.xml (added)
+++ myfaces/trunk/tlds/entities/standard_panel_grid_attributes.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,30 @@
+ &ui_panel_attributes;
+ &html_universal_attributes;
+ &html_event_handler_attributes;
+ &html_table_attributes;
+ <!-- GridRenderer attributes -->
+ <attribute>
+ <name>columnClasses</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>columns</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>footerClass</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>headerClass</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>rowClasses</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
Added: myfaces/trunk/tlds/entities/standard_select_boolean_checkbox_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/tlds/entities/standard_select_boolean_checkbox_attributes.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/tlds/entities/standard_select_boolean_checkbox_attributes.xml (added)
+++ myfaces/trunk/tlds/entities/standard_select_boolean_checkbox_attributes.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,4 @@
+ &ui_select_boolean_attributes;
+ &html_universal_attributes;
+ &html_event_handler_attributes;
+ &html_input_checkbox_attributes;
\ No newline at end of file
Added: myfaces/trunk/tlds/entities/standard_select_many_listbox_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/tlds/entities/standard_select_many_listbox_attributes.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/tlds/entities/standard_select_many_listbox_attributes.xml (added)
+++ myfaces/trunk/tlds/entities/standard_select_many_listbox_attributes.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,12 @@
+ &ui_select_many_attributes;
+ &html_universal_attributes;
+ &html_event_handler_attributes;
+ &html_select_attributes;
+ <!-- ListboxRenderer attributes -->
+ <attribute>
+ <name>size</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>see JSF Spec.</description>
+ </attribute>
Added: myfaces/trunk/tlds/entities/standard_select_many_menu_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/tlds/entities/standard_select_many_menu_attributes.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/tlds/entities/standard_select_many_menu_attributes.xml (added)
+++ myfaces/trunk/tlds/entities/standard_select_many_menu_attributes.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,4 @@
+ &ui_select_many_attributes;
+ &html_universal_attributes;
+ &html_event_handler_attributes;
+ &html_select_attributes;
\ No newline at end of file
Added: myfaces/trunk/tlds/entities/standard_select_one_listbox_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/tlds/entities/standard_select_one_listbox_attributes.xml?rev=170466&view=auto
==============================================================================
--- myfaces/trunk/tlds/entities/standard_select_one_listbox_attributes.xml (added)
+++ myfaces/trunk/tlds/entities/standard_select_one_listbox_attributes.xml Mon May 16 14:48:17 2005
@@ -0,0 +1,12 @@
+ &ui_select_one_attributes;
+ &html_universal_attributes;
+ &html_event_handler_attributes;
+ &html_select_attributes;
+ <!-- ListboxRenderer attributes -->
+ <attribute>
+ <name>size</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>see JSF Spec.</description>
+ </attribute>