You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/05/10 10:40:23 UTC
svn commit: r405676 - in /myfaces/tobago/trunk: core/
core/src/main/java/org/apache/myfaces/tobago/
core/src/main/java/org/apache/myfaces/tobago/component/
core/src/main/java/org/apache/myfaces/tobago/taglib/component/
core/src/main/java/org/apache/myf...
Author: bommel
Date: Wed May 10 01:40:20 2006
New Revision: 405676
URL: http://svn.apache.org/viewcvs?rev=405676&view=rev
Log:
added selectItems fix for menubar
Added:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuCheckboxExtensionTag.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java
Modified:
myfaces/tobago/trunk/core/pom.xml
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuRadioTag.java
myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/menubar.jsp
myfaces/tobago/trunk/example/demo/src/main/webapp/overview/menubar.jsp
myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java
Modified: myfaces/tobago/trunk/core/pom.xml
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/pom.xml?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/pom.xml (original)
+++ myfaces/tobago/trunk/core/pom.xml Wed May 10 01:40:20 2006
@@ -188,6 +188,15 @@
</dependencies>
+ <!--<repositories>
+ <repository>
+ <id>java-net</id>
+ <name>java.net Repository</name>
+ <url>https://maven-repository.dev.java.net/nonav/repository/</url>
+ <layout>legacy</layout>
+ </repository>
+ </repositories>-->
+
<profiles>
<!-- Mac OS X has not a tools.jar! -->
<profile>
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java Wed May 10 01:40:20 2006
@@ -147,12 +147,12 @@
public static final String ATTR_WIDTH_LIST = "widthList";
public static final String ATTR_WIDTH_LIST_STRING = "widthListString";
- public static final String FACET_CHECKBOX = "checkbox";
public static final String FACET_CONFIRMATION = "confirmation";
public static final String FACET_LABEL = "label";
public static final String FACET_LAYOUT = "layout";
public static final String FACET_LAYOUT_DEFAULT = "layoutDefault";
- public static final String FACET_IMAGE= "image ";
+ public static final String FACET_IMAGE = "image ";
+ public static final String FACET_ITEMS = "items";
public static final String FACET_MENUBAR = "menuBar";
public static final String FACET_MENUPOPUP = "menupopup";
public static final String FACET_PAGER_LINKS = "pagerLinks";
@@ -160,7 +160,6 @@
public static final String FACET_PAGER_ROW = "pagerRow";
public static final String FACET_PICKER = "picker";
public static final String FACET_PICKER_POPUP = "pickerPopup";
- public static final String FACET_RADIO = "radio";
public static final String FACET_TOOL_BAR= "toolBar";
public static final String FACET_TOOL_BAR_COMMAND = "toolBarCommand";
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java Wed May 10 01:40:20 2006
@@ -40,9 +40,8 @@
import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_NAVIGATE;
import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_RESET;
import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_SCRIPT;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_CHECKBOX;
import static org.apache.myfaces.tobago.TobagoConstants.FACET_LABEL;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_RADIO;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_ITEMS;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_OUT;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_SELECT_BOOLEAN_CHECKBOX;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_SELECT_ONE_RADIO;
@@ -680,7 +679,7 @@
if (valueBinding != null) {
radio = (UIMenuSelectOne) createComponent(facesContext,
UIMenuSelectOne.COMPONENT_TYPE, RENDERER_TYPE_SELECT_ONE_RADIO);
- command.getFacets().put(FACET_RADIO, radio);
+ command.getFacets().put(FACET_ITEMS, radio);
radio.setValueBinding(ATTR_VALUE, valueBinding);
}
return radio;
@@ -702,7 +701,7 @@
if (valueBinding != null) {
checkbox = createComponent(facesContext, UISelectBoolean.COMPONENT_TYPE,
RENDERER_TYPE_SELECT_BOOLEAN_CHECKBOX);
- command.getFacets().put(FACET_CHECKBOX, checkbox);
+ command.getFacets().put(FACET_ITEMS, checkbox);
checkbox.setValueBinding(ATTR_VALUE, valueBinding);
}
return checkbox;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuRadioTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuRadioTag.java?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuRadioTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuRadioTag.java Wed May 10 01:40:20 2006
@@ -21,6 +21,6 @@
*/
public class MenuRadioTag extends SelectOneCommandTag
- implements MenuSelectOneTagDeclaration {
+ implements MenuRadioTagDeclaration {
}
Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuCheckboxExtensionTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuCheckboxExtensionTag.java?rev=405676&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuCheckboxExtensionTag.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuCheckboxExtensionTag.java Wed May 10 01:40:20 2006
@@ -0,0 +1,173 @@
+package org.apache.myfaces.tobago.taglib.extension;
+
+/*
+ * Copyright 2002-2006 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.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.taglib.component.CommandTagDeclaration;
+import org.apache.myfaces.tobago.taglib.component.MenuCommandTag;
+import org.apache.myfaces.tobago.taglib.component.SelectBooleanCheckboxTag;
+import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
+import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
+import org.apache.myfaces.tobago.taglib.decl.HasBooleanValue;
+import org.apache.myfaces.tobago.taglib.decl.IsImmediateCommand;
+import org.apache.myfaces.tobago.taglib.decl.HasLabel;
+
+import javax.servlet.jsp.tagext.BodyTagSupport;
+import javax.servlet.jsp.JspException;
+import javax.faces.webapp.FacetTag;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 09.05.2006
+ * Time: 00:00:49
+ * To change this template use File | Settings | File Templates.
+ */
+
+@Tag(name = "menuCheckbox", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
+public class MenuCheckboxExtensionTag extends BodyTagSupport implements CommandTagDeclaration,
+ HasIdBindingAndRendered, IsDisabled, HasBooleanValue, HasLabel,
+ IsImmediateCommand {
+ private String rendered;
+ private String value;
+
+ private MenuCommandTag menuCommandTag;
+ private SelectBooleanCheckboxTag selectBooleanCheckbox;
+ private FacetTag facetTag;
+ private String action;
+ private String actionListener;
+ private String onclick;
+ private String link;
+ private String disabled;
+ private String binding;
+ private String label;
+ private String immediate;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ menuCommandTag = new MenuCommandTag();
+ menuCommandTag.setPageContext(pageContext);
+ menuCommandTag.setParent(getParent()); // ???
+ if (rendered != null) {
+ menuCommandTag.setRendered(rendered);
+ }
+ if (action != null) {
+ menuCommandTag.setAction(action);
+ }
+ if (actionListener != null) {
+ menuCommandTag.setActionListener(actionListener);
+ }
+ if (onclick != null) {
+ menuCommandTag.setOnclick(onclick);
+ }
+ if (link != null) {
+ menuCommandTag.setLink(link);
+ }
+ if (disabled != null) {
+ menuCommandTag.setDisabled(disabled);
+ }
+ if (binding !=null) {
+ menuCommandTag.setBinding(binding);
+ }
+ if (label != null) {
+ menuCommandTag.setLabel(label);
+ }
+ if (immediate != null) {
+ menuCommandTag.setImmediate(immediate);
+ }
+ menuCommandTag.doStartTag();
+
+ facetTag = new FacetTag();
+ facetTag.setPageContext(pageContext);
+ facetTag.setParent(menuCommandTag);
+ facetTag.setName(org.apache.myfaces.tobago.TobagoConstants.FACET_ITEMS);
+
+ facetTag.doStartTag();
+ selectBooleanCheckbox = new SelectBooleanCheckboxTag();
+ selectBooleanCheckbox.setPageContext(pageContext);
+ if (value != null) {
+ selectBooleanCheckbox.setValue(value);
+ }
+ selectBooleanCheckbox.setParent(facetTag);
+ selectBooleanCheckbox.doStartTag();
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectBooleanCheckbox.doEndTag();
+ facetTag.doEndTag();
+ menuCommandTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public void setActionListener(String actionListener) {
+ this.actionListener = actionListener;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setLink(String navigate) {
+ this.link = navigate;
+ }
+
+ public void setBinding(String binding) throws JspException {
+ this.binding = binding;
+ }
+
+ public void setRendered(String rendered) {
+ this.rendered = rendered;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void release() {
+ super.release();
+ rendered = null;
+ value = null;
+ action = null;
+ actionListener = null;
+ onclick = null;
+ link = null;
+ disabled = null;
+ binding = null;
+ label = null;
+ immediate = null;
+ }
+
+}
Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java?rev=405676&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java Wed May 10 01:40:20 2006
@@ -0,0 +1,179 @@
+package org.apache.myfaces.tobago.taglib.extension;
+
+/*
+ * Copyright 2002-2005 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.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.taglib.component.MenuCommandTag;
+import org.apache.myfaces.tobago.taglib.component.CommandTagDeclaration;
+import org.apache.myfaces.tobago.taglib.component.SelectOneRadioTag;
+import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
+import org.apache.myfaces.tobago.taglib.decl.HasLabel;
+import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
+import org.apache.myfaces.tobago.taglib.decl.HasAction;
+import org.apache.myfaces.tobago.taglib.decl.HasValue;
+import org.apache.myfaces.tobago.taglib.decl.IsImmediateCommand;
+import org.apache.myfaces.tobago.taglib.decl.HasActionListener;
+
+import javax.faces.webapp.FacetTag;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.BodyTagSupport;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 09.05.2006
+ * Time: 17:41:39
+ * To change this template use File | Settings | File Templates.
+ */
+
+@Tag(name = "menuRadio", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
+
+public class MenuRadioExtensionTag extends BodyTagSupport implements CommandTagDeclaration,
+ HasIdBindingAndRendered, HasLabel, IsDisabled, HasAction, HasActionListener, HasValue, IsImmediateCommand {
+
+ private String rendered;
+ private String value;
+
+ private MenuCommandTag menuCommandTag;
+ private SelectOneRadioTag selectOneRadio;
+ private FacetTag facetTag;
+ private String action;
+ private String actionListener;
+ private String onclick;
+ private String link;
+ private String disabled;
+ private String binding;
+ private String label;
+ private String immediate;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ menuCommandTag = new MenuCommandTag();
+ menuCommandTag.setPageContext(pageContext);
+ menuCommandTag.setParent(getParent());
+
+ if (rendered != null) {
+ menuCommandTag.setRendered(rendered);
+ }
+ if (action != null) {
+ menuCommandTag.setAction(action);
+ }
+ if (actionListener != null) {
+ menuCommandTag.setActionListener(actionListener);
+ }
+ if (onclick != null) {
+ menuCommandTag.setOnclick(onclick);
+ }
+ if (link != null) {
+ menuCommandTag.setLink(link);
+ }
+ if (disabled != null) {
+ menuCommandTag.setDisabled(disabled);
+ }
+ if (binding != null) {
+ menuCommandTag.setBinding(binding);
+ }
+ if (label != null) {
+ menuCommandTag.setLabel(label);
+ }
+ if (immediate != null) {
+ menuCommandTag.setImmediate(immediate);
+ }
+ menuCommandTag.doStartTag();
+
+ facetTag = new FacetTag();
+ facetTag.setPageContext(pageContext);
+ facetTag.setParent(menuCommandTag);
+ facetTag.setName(org.apache.myfaces.tobago.TobagoConstants.FACET_ITEMS);
+
+ facetTag.doStartTag();
+ selectOneRadio = new SelectOneRadioTag();
+ selectOneRadio.setPageContext(pageContext);
+ selectOneRadio.setParent(facetTag);
+ if (value != null) {
+ selectOneRadio.setValue(value);
+ }
+ selectOneRadio.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectOneRadio.doEndTag();
+ facetTag.doEndTag();
+ menuCommandTag.doEndTag();
+
+ return super.doEndTag();
+ }
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public void setActionListener(String actionListener) {
+ this.actionListener = actionListener;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setLink(String navigate) {
+ this.link = navigate;
+ }
+
+ public void setBinding(String binding) throws JspException {
+ this.binding = binding;
+ }
+
+ public void setRendered(String rendered) {
+ this.rendered = rendered;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void release() {
+ super.release();
+ rendered = null;
+ value = null;
+ action = null;
+ actionListener = null;
+ onclick = null;
+ link = null;
+ disabled = null;
+ binding = null;
+ label = null;
+ immediate = null;
+ }
+
+}
Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/menubar.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/menubar.jsp?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/menubar.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/menubar.jsp Wed May 10 01:40:20 2006
@@ -53,8 +53,7 @@
<tc:menu label="#{overviewBundle.menu_config}">
<tc:menu label="#{overviewBundle.menu_themes}">
<tc:menuRadio value="#{clientConfigController.theme}"
- action="#{clientConfigController.submit}"
- >
+ action="#{clientConfigController.submit}" >
<f:selectItems value="#{clientConfigController.themeItems}"/>
</tc:menuRadio>
</tc:menu>
Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/overview/menubar.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/demo/src/main/webapp/overview/menubar.jsp?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/overview/menubar.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/overview/menubar.jsp Wed May 10 01:40:20 2006
@@ -14,6 +14,7 @@
* limitations under the License.
--%>
<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
+<%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%-- !!!!!! no <f:subview here !!!!!!! --%>
<f:facet name="menuBar" >
@@ -63,16 +64,19 @@
</tc:menu>
<tc:menu label="#{overviewBundle.menu_config}" >
<tc:menu label="#{overviewBundle.menu_themes}" >
- <tc:menuRadio value="#{clientConfigController.theme}"
- action="#{clientConfigController.submit}">
- <f:selectItems value="#{clientConfigController.themeItems}" />
- </tc:menuRadio>
+ <tc:menuItem action="#{clientConfigController.submit}">
+ <f:facet name="items">
+ <tc:selectOneRadio value="#{clientConfigController.theme}" >
+ <f:selectItems value="#{clientConfigController.themeItems}" />
+ </tc:selectOneRadio>
+ </f:facet>
+ </tc:menuItem>
</tc:menu>
<tc:menu label="#{overviewBundle.menu_locale}">
- <tc:menuRadio value="#{clientConfigController.locale}"
- action="#{clientConfigController.submit}">
+ <tx:menuRadio action="#{clientConfigController.submit}"
+ value="#{clientConfigController.locale}">
<f:selectItems value="#{clientConfigController.localeItems}" />
- </tc:menuRadio>
+ </tx:menuRadio>
</tc:menu>
<%-- <tc:menuCheckbox action="#{clientConfigController.submit}"
label="#{overviewBundle.menu_debug}"
Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp Wed May 10 01:40:20 2006
@@ -196,9 +196,13 @@
<tc:menuSeparator/>
- <tc:menuCheckbox label="#{overviewBundle.toolbar_linkClickme}" value="#{demo.bool[0]}" />
+ <tc:menuItem label="#{overviewBundle.toolbar_linkClickme}" >
+ <f:facet name="items">
+ <tc:selectBooleanCheckbox value="#{demo.bool[0]}" />
+ </f:facet>
+ </tc:menuItem>
<tc:menuCheckbox label="#{overviewBundle.toolbar_linkClickme}" value="#{demo.bool[1]}" />
- <tc:menuCheckbox label="#{overviewBundle.toolbar_linkClickme}" value="#{demo.bool[2]}" />
+ <tx:menuCheckbox label="#{overviewBundle.toolbar_linkClickme}" value="#{demo.bool[2]}" />
</tc:menu>
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java Wed May 10 01:40:20 2006
@@ -33,13 +33,11 @@
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_CLASS;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_VALUE;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_CHECKBOX;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_RADIO;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_ITEMS;
import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
import org.apache.myfaces.tobago.component.ComponentUtil;
import org.apache.myfaces.tobago.component.UIMenu;
import org.apache.myfaces.tobago.component.UIMenuCommand;
-import org.apache.myfaces.tobago.component.UIMenuSelectOne;
import org.apache.myfaces.tobago.component.UIMenuSeparator;
import org.apache.myfaces.tobago.component.UIPage;
import org.apache.myfaces.tobago.component.UISelectBooleanCommand;
@@ -58,6 +56,8 @@
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIPanel;
+import javax.faces.component.UISelectOne;
+import javax.faces.component.UISelectBoolean;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.model.SelectItem;
@@ -347,7 +347,16 @@
UICommand command) throws IOException {
String onClick = createOnClick(facesContext, command);
if (command instanceof UIMenuCommand) {
- addCommand(sb, var, facesContext, command, onClick);
+ if (command.getFacet(FACET_ITEMS) != null) {
+ UIComponent facet = command.getFacet(FACET_ITEMS);
+ if (facet instanceof UISelectOne) {
+ addSelectOne(sb, var, facesContext, command, onClick);
+ } else if (facet instanceof UISelectBoolean) {
+ addSelectBoolean(sb, var, facesContext, command, onClick);
+ }
+ } else {
+ addCommand(sb, var, facesContext, command, onClick);
+ }
} else if (command instanceof UISelectBooleanCommand) {
addSelectBoolean(sb, var, facesContext, command, onClick);
} else if (command instanceof UISelectOneCommand) {
@@ -383,13 +392,13 @@
FacesContext facesContext, UICommand command, String onClick)
throws IOException {
- UIComponent checkbox = command.getFacet(FACET_CHECKBOX);
+ UIComponent checkbox = command.getFacet(FACET_ITEMS);
if (checkbox == null) {
checkbox = ComponentUtil.createUISelectBooleanFacet(facesContext, command);
checkbox.setId(facesContext.getViewRoot().createUniqueId());
}
- final boolean checked = ComponentUtil.getBooleanAttribute(command, ATTR_VALUE);
+ final boolean checked = ComponentUtil.getBooleanAttribute(checkbox, ATTR_VALUE);
String clientId = checkbox.getClientId(facesContext);
onClick = RenderUtil.addMenuCheckToggle(clientId, onClick);
@@ -413,15 +422,18 @@
throws IOException {
onClick = CommandRendererBase.appendConfirmationScript(onClick, command,
facesContext);
- List<SelectItem> items = ComponentUtil.getSelectItems(command);
+ List<SelectItem> items;
LabelWithAccessKey label = new LabelWithAccessKey(command);
- UIMenuSelectOne radio = (UIMenuSelectOne) command.getFacet(FACET_RADIO);
+ UISelectOne radio = (UISelectOne) command.getFacet(FACET_ITEMS);
if (radio == null) {
+ items = ComponentUtil.getSelectItems(command);
radio = ComponentUtil.createUIMenuSelectOneFacet(facesContext, command);
radio.setId(facesContext.getViewRoot().createUniqueId());
+ } else {
+ items = ComponentUtil.getSelectItems(radio);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java?rev=405676&r1=405675&r2=405676&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java Wed May 10 01:40:20 2006
@@ -34,9 +34,8 @@
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SUPPPRESS_TOOLBAR_CONTAINER;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_VALUE;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_CHECKBOX;
import static org.apache.myfaces.tobago.TobagoConstants.FACET_MENUPOPUP;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_RADIO;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_ITEMS;
import static org.apache.myfaces.tobago.TobagoConstants.FACET_TOOL_BAR;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_BOX;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_MENUBAR;
@@ -61,6 +60,8 @@
import javax.faces.component.UIComponent;
import javax.faces.component.UIPanel;
import javax.faces.component.UIViewRoot;
+import javax.faces.component.UISelectBoolean;
+import javax.faces.component.UISelectOne;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import java.io.IOException;
@@ -140,11 +141,18 @@
} else if (command instanceof UISelectOneCommand) {
renderSelectOne(facesContext, command, writer, boxFacet, addExtraHoverClass);
} else {
-
- String onClick = createOnClick(facesContext, command);
- renderToolbarButton(facesContext, command, writer, boxFacet, addExtraHoverClass, false, onClick);
+ if (command.getFacet(FACET_ITEMS) != null) {
+ UIComponent facet = command.getFacet(FACET_ITEMS);
+ if (facet instanceof UISelectBoolean) {
+ renderSelectBoolean(facesContext, command, writer, boxFacet, addExtraHoverClass);
+ } else if (facet instanceof UISelectOne) {
+ renderSelectOne(facesContext, command, writer, boxFacet, addExtraHoverClass);
+ }
+ } else {
+ String onClick = createOnClick(facesContext, command);
+ renderToolbarButton(facesContext, command, writer, boxFacet, addExtraHoverClass, false, onClick);
+ }
}
-
}
private void renderSelectOne(FacesContext facesContext, UICommand command,
@@ -154,12 +162,15 @@
String onClick = createOnClick(facesContext, command);
onClick = CommandRendererBase.appendConfirmationScript(onClick, command, facesContext);
- List<SelectItem> items = ComponentUtil.getSelectItems(command);
+ List<SelectItem> items;
- UIMenuSelectOne radio = (UIMenuSelectOne) command.getFacet(FACET_RADIO);
+ UIMenuSelectOne radio = (UIMenuSelectOne) command.getFacet(FACET_ITEMS);
if (radio == null) {
+ items = ComponentUtil.getSelectItems(command);
radio = ComponentUtil.createUIMenuSelectOneFacet(facesContext, command);
radio.setId(facesContext.getViewRoot().createUniqueId());
+ } else {
+ items = ComponentUtil.getSelectItems(radio);
}
@@ -220,13 +231,13 @@
TobagoResponseWriter writer, boolean boxFacet, boolean addExtraHoverClass)
throws IOException {
- UIComponent checkbox = command.getFacet(FACET_CHECKBOX);
+ UIComponent checkbox = command.getFacet(FACET_ITEMS);
if (checkbox == null) {
checkbox = ComponentUtil.createUISelectBooleanFacet(facesContext, command);
checkbox.setId(facesContext.getViewRoot().createUniqueId());
}
- final boolean checked = ComponentUtil.getBooleanAttribute(command, ATTR_VALUE);
+ final boolean checked = ComponentUtil.getBooleanAttribute(checkbox, ATTR_VALUE);
String onClick = createOnClick(facesContext, command);