Author: Alex.Kolonitsky
Date: 2010-10-31 16:24:22 -0400 (Sun, 31 Oct 2010)
New Revision: 19806
Added:
trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
trunk/examples/output-demo/src/main/webapp/resources/PanelMenu.js
trunk/examples/output-demo/src/main/webapp/resources/PanelMenuGroup.js
trunk/examples/output-demo/src/main/webapp/resources/PanelMenuItem.js
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-item-qunit.js
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-qunit.js
trunk/ui/output/api/src/main/java/org/richfaces/ExpandMode.java
trunk/ui/output/api/src/main/java/org/richfaces/IconPosition.java
trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuGroupTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuItemTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuGroupRendererTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuItemRendererTest.java
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml
Modified:
trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
trunk/ui/output/ui/checkstyle-suppressions.xml
trunk/ui/output/ui/richfaces-suppressions.xml
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java
trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
Log:
RF-9317 panelMenu components
Modified: trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-10-31
17:38:22 UTC (rev 19805)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -9,15 +9,15 @@
</managed-bean>
<navigation-rule>
- <navigation-case>
+ <navigation-case>
<from-outcome>panel</from-outcome>
<to-view-id>/examples/panel.xhtml</to-view-id>
</navigation-case>
- <navigation-case>
+ <navigation-case>
<from-outcome>popup</from-outcome>
<to-view-id>/examples/popupPanel.xhtml</to-view-id>
</navigation-case>
- <navigation-case>
+ <navigation-case>
<from-outcome>progressbar</from-outcome>
<to-view-id>/examples/progressbar.xhtml</to-view-id>
</navigation-case>
@@ -86,6 +86,16 @@
<to-view-id>/qunit/tabPanel.xhtml</to-view-id>
</navigation-case>
+ <!-- PanelMenu navigation -->
+ <navigation-case>
+ <from-outcome>panelMenu</from-outcome>
+ <to-view-id>/examples/panelMenu.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>qunit/panelMenu</from-outcome>
+ <to-view-id>/qunit/panelMenu.xhtml</to-view-id>
+ </navigation-case>
+
<!-- Tooltip navigation -->
<navigation-case>
<from-outcome>tooltip</from-outcome>
Added: trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
(rev 0)
+++ trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,51 @@
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="scripts">
+ <h:outputScript name="PanelMenu.js" />
+ </ui:define>
+
+ <ui:define name="title">PANEL MENU JS Development</ui:define>
+ <ui:define name="body_head">PANEL MENU JS
Development</ui:define>
+
+ <ui:define name="body">
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:panelMenu id="panelMenu">
+ <!-- TODO -->
+ </pn:panelMenu>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</body>
+</html>
+
Added: trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
(rev 0)
+++ trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml 2010-10-31 20:24:22
UTC (rev 19806)
@@ -0,0 +1,88 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="scripts">
+ <h:outputScript name="qunit/qunit.js"/>
+ <h:outputScript name="qunit/richfaces-qunit.js"/>
+
+ <h:outputScript name="PanelMenu.js"/>
+ <h:outputScript name="PanelMenuItem.js"/>
+ <h:outputScript name="PanelMenuGroup.js"/>
+
+ <h:outputStylesheet name="qunit/qunit.css"/>
+ </ui:define>
+
+ <ui:define name="title">PanelMenu Example</ui:define>
+ <ui:define name="body_head">PanelMenu Example</ui:define>
+
+ <ui:define name="body">
+ <p>Page</p>
+
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:panelMenu id="panelMenu" expandSingle="true"
activeItem="myFavariteIten">
+ <pn:panelMenuGroup label="Group 1" mode="ajax"
expandSingle="true">
+ <pn:panelMenuItem label="Item 1.1"
mode="ajax"/>
+ <pn:panelMenuItem label="Item 1.2"
mode="ajax"/>
+ <pn:panelMenuItem label="Item 1.3"
mode="ajax"/>
+ </pn:panelMenuGroup>
+ <pn:panelMenuGroup label="Group 2" mode="ajax"
expandSingle="true">
+ <pn:panelMenuItem label="Item 2.1"
mode="ajax"/>
+ <pn:panelMenuGroup label="Group 2.2"
mode="ajax" expandSingle="true">
+ <pn:panelMenuItem label="Item 2.2.1"
mode="ajax"/>
+ <pn:panelMenuItem name="myFavariteIten"
label="Item 2.2.2" mode="ajax"/>
+ <pn:panelMenuItem label="Item 2.2.3"
mode="ajax"/>
+ </pn:panelMenuGroup>
+ <pn:panelMenuItem label="Item 2.3"
mode="ajax"/>
+ </pn:panelMenuGroup>
+ <pn:panelMenuGroup label="Group 3" mode="ajax"
expandSingle="true">
+ <pn:panelMenuItem label="Item 3.1"
mode="ajax"/>
+ <pn:panelMenuItem label="Item 3.2"
mode="ajax"/>
+ <pn:panelMenuItem label="Item 3.3"
mode="ajax" />
+ </pn:panelMenuGroup>
+ </pn:panelMenu>
+ </h:form>
+
+ <p>Result</p>
+
+ <div>
+ <ol id="qunit-tests"></ol>
+
+ <div id="testDiv" style="margin-top:10px; border:1px solid
#a0a0a0">Main Test Div</div>
+ </div>
+ <h:outputScript name="tests/richfaces-panel-menu-qunit.js"/>
+ </ui:define>
+</ui:composition>
+</body>
+</html>
+
Added: trunk/examples/output-demo/src/main/webapp/resources/PanelMenu.js
===================================================================
--- trunk/examples/output-demo/src/main/webapp/resources/PanelMenu.js
(rev 0)
+++ trunk/examples/output-demo/src/main/webapp/resources/PanelMenu.js 2010-10-31 20:24:22
UTC (rev 19806)
@@ -0,0 +1,205 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ expandSingle : true
+ };
+
+ rf.ui.PanelMenu = rf.BaseComponent.extendClass({
+ // class name
+ name:"PanelMenu",
+
+ /**
+ * @class PanelMenu
+ * @name PanelMenu
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ this.id = componentId;
+ this.items = [];
+ this.attachToDom(componentId);
+
+ this.options = $.extend({}, __DEFAULT_OPTIONS, options || {});
+ this.activeItem = this.__getValueInput().value;
+
+ var menuGroup = this;
+ if (menuGroup.options.expandSingle) {
+ menuGroup.__panelMenu().bind("expand", function (event) {
+ menuGroup.__childGroups().each (function (index, group) {
+ if (event.target.id != group.id) {
+ rf.$(group.id).collapse();
+ }
+ });
+
+ event.stopPropagation();
+ });
+ }
+
+ if (menuGroup.activeItem) {
+ this.__panelMenu().ready(function () {
+ var item = menuGroup.items[menuGroup.activeItem];
+ item.__select();
+ item.__fireSelect();
+ })
+ }
+
+ this.__addUserEventHandler("collapse");
+ this.__addUserEventHandler("expand");
+ },
+
+ getItems: function () {
+ return this.items;
+ },
+
+ getItem: function (name) {
+ return this.items[name];
+ },
+
+ /***************************** Public Methods
****************************************************************/
+ /**
+ * @methodOf
+ * @name PanelMenu#selectItem
+ *
+ * TODO ...
+ *
+ * @param {String} name
+ * @return {void} TODO ...
+ */
+ selectItem: function (name) {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#selectedItem
+ *
+ * TODO ...
+ *
+ * @return {String} TODO ...
+ */
+ selectedItem: function (id) {
+ if (id != undefined) {
+ var valueInput = this.__getValueInput();
+ var prevActiveItem = valueInput.value;
+
+ this.activeItem = id;
+ valueInput.value = id;
+
+ return prevActiveItem;
+ } else {
+ return this.activeItem;
+ }
+ },
+
+ __getValueInput : function() {
+ return document.getElementById(this.id + "-value");
+ },
+
+ selectItem: function (itemName) {
+ // TODO
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#expandAll
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ expandAll: function () {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#collapseAll
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ collapseAll: function () {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#expandGroup
+ *
+ * TODO ...
+ *
+ * @param {String} groupName
+ * @return {void} TODO ...
+ */
+ expandGroup: function (groupName) {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#collapseGroup
+ *
+ * TODO ...
+ *
+ * @param {String} groupName
+ * @return {void} TODO ...
+ */
+ collapseGroup: function (groupName) {
+ // TODO implement
+ },
+
+
+ /***************************** Private Methods
****************************************************************/
+ __panelMenu : function () {
+ return $(rf.getDomElement(this.id));
+ },
+
+ __childGroups : function () {
+ return this.__panelMenu().children(".rf-pm-gr")
+ },
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "."+this.namespace);
+
+ this.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Added: trunk/examples/output-demo/src/main/webapp/resources/PanelMenuGroup.js
===================================================================
--- trunk/examples/output-demo/src/main/webapp/resources/PanelMenuGroup.js
(rev 0)
+++ trunk/examples/output-demo/src/main/webapp/resources/PanelMenuGroup.js 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,363 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ expanded : false,
+ expandSingle : true,
+ bubbleSelection : true,
+ stylePrefix : "rf-pm-gr",
+
+ // TODO we should use selectionType = {none, selectable, unselectable}
+ selectable : false,
+ unselectable : false // unselectable can be only selectable item => if
selectable == false than unselectable = false
+ };
+
+ var EXPAND_ITEM = {
+
+ /**
+ *
+ * @return {void}
+ * */
+ exec : function (group, expand) {
+ var mode = group.mode;
+ if (mode == "server") {
+ return this.execServer(group);
+ } else if (mode == "ajax") {
+ return this.execAjax(group);
+ } else if (mode == "client" || mode == "none") {
+ return this.execClient(group, expand);
+ } else {
+ rf.log.error("EXPAND_ITEM.exec : unknown mode (" + mode +
")");
+ }
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execServer : function (group) {
+ group.__changeState();
+ rf.submitForm(this.__getParentForm(group));
+
+ return false;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (group) {
+ var oldState = group.__changeState();
+ rf.ajax(group.id, null, $.extend({}, group.options["ajax"], {}));
+ group.__restoreState(oldState);
+
+ return true;
+ },
+
+ /**
+ * @protected
+ *
+ * @param {PanelMenuGroup} group
+ * @param {Boolean} expand
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (group, expand) {
+ if (expand) {
+ group.expand();
+ } else {
+ group.collapse();
+ }
+
+ return group.__fireSwitch();
+ },
+
+ /**
+ * @private
+ * */
+ __getParentForm : function (item) {
+ return $($(rf.getDomElement(item.id)).parents("form")[0]);
+ }
+ };
+
+ rf.ui.PanelMenuGroup = rf.ui.PanelMenuItem.extendClass({
+ // class name
+ name:"PanelMenuGroup",
+
+ /**
+ * @class PanelMenuGroup
+ * @name PanelMenuGroup
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ this.options = $.extend({}, __DEFAULT_OPTIONS, options || {});
+
+ rf.ui.PanelMenuItem.call(this, componentId);
+
+ if (!this.options.disabled) {
+ var menuGroup = this;
+
+ if (!this.options.selectable) {
+ this.__header().bind("click", function () {
+ return menuGroup.switchExpantion();
+ });
+ }
+
+ if (this.options.selectable || this.options.bubbleSelection) {
+ this.__content().bind("select", function (event) {
+ if (menuGroup.options.selectable &&
menuGroup.__isMyEvent(event)) {
+ menuGroup.expand();
+ }
+
+ if (menuGroup.options.bubbleSelection &&
!menuGroup.__isMyEvent(event)) {
+ menuGroup.__select();
+ if (!menuGroup.expanded()) {
+ menuGroup.expand();
+ }
+ }
+ });
+
+ this.__content().bind("unselect", function (event) {
+ if (menuGroup.options.selectable &&
menuGroup.__isMyEvent(event)) {
+ menuGroup.collapse();
+ }
+
+ if (menuGroup.options.bubbleSelection &&
!menuGroup.__isMyEvent(event)) {
+ menuGroup.__unselect();
+ }
+ });
+ }
+
+ if (menuGroup.options.expandSingle) {
+ menuGroup.__group().bind("expand", function (event) {
+ if (menuGroup.__isMyEvent(event)) {
+ return;
+ }
+
+ menuGroup.__childGroups().each (function (index, group) {
+ var rfGroup = rf.$(group);
+ if (!rfGroup.__isMyEvent(event)) {
+ rfGroup.collapse();
+ }
+ });
+
+ event.stopPropagation();
+ });
+ }
+
+ this.__addUserEventHandler("collapse");
+ this.__addUserEventHandler("expand");
+ }
+ },
+
+ /***************************** Public Methods
****************************************************************/
+ expanded : function () {
+ // TODO check invariant in dev mode
+ // return this.__content().hasClass("rf-pm-exp")
+ return this.__getExpandValue();
+ },
+
+ expand : function () {
+ this.__expand();
+
+ return this.__fireExpand();
+ },
+
+ __expand : function () {
+
this.__content().removeClass("rf-pm-colps").addClass("rf-pm-exp");
+ this.__setExpandValue(true);
+ },
+
+ collapsed : function () {
+ // TODO check invariant in dev mode
+ // return this.__content().hasClass("rf-pm-colps")
+ return !this.__getExpandValue();
+ },
+
+ collapse : function () {
+ this.__collapse();
+
+ this.__childGroups().each (function(index, group) {
+ rf.$(group.id).__collapse();
+ });
+
+ this.__fireCollapse();
+ },
+
+ __collapse : function () {
+
this.__content().addClass("rf-pm-colps").removeClass("rf-pm-exp");
+ this.__setExpandValue(false);
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuGroup#switch
+ *
+ * TODO ...
+ *
+ * @param {boolean} expand
+ * @return {void} TODO ...
+ */
+ switchExpantion : function () { // TODO rename
+ var continueProcess = this.__fireBeforeSwitch();
+ if (!continueProcess) {
+ return false;
+ }
+
+ EXPAND_ITEM.exec(this, !this.expanded());
+ },
+
+ /**
+ * please, remove this method when client side ajax events will be added
+ *
+ * */
+ onCompleteHandler : function () {
+ EXPAND_ITEM.execClient(this, this.expanded());
+ },
+
+ __switch : function (expand) {
+ if (expand) {
+ this.expand();
+ } else {
+ this.collapse();
+ }
+ },
+
+ /***************************** Private Methods
****************************************************************/
+ __parentGroup : function () {
+ var parentGroup = this.__group().parents(".rf-pm-gr")[0];
+ if (parentGroup) {
+ return parentGroup;
+ }
+ return this.__panelMenu();
+ },
+
+ __childGroups : function () {
+ return this.__content().children(".rf-pm-gr")
+ },
+
+ __group : function () {
+ return $(rf.getDomElement(this.id))
+ },
+
+ __header : function () {
+ return $(rf.getDomElement(this.id + ":hdr"))
+ },
+
+ __content : function () {
+ return $(rf.getDomElement(this.id + ":cnt"))
+ },
+
+ __expandValueInput : function () {
+ return document.getElementById(this.id + ":expanded");
+ },
+
+ __getExpandValue : function () {
+ return this.__expandValueInput().value == "true";
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuGroup#__setExpandValue
+ *
+ * @param {boolean} value - is group expanded?
+ * @return {boolean} preview value
+ */
+ __setExpandValue : function (value) {
+ var input = this.__expandValueInput();
+ var oldValue = input.value;
+
+ input.value = value;
+
+ return oldValue;
+ },
+
+ __changeState : function () {
+ var state = {};
+ state["expanded"] =
this.__setExpandValue(this.__getExpandValue());
+ if (this.options.selectable) {
+ state["itemName"] =
this.__rfPanelMenu().selectedItem(this.itemName); // TODO bad function name for function
which change component state
+ }
+
+ return state;
+ },
+
+ __restoreState : function (state) {
+ if (!state) {
+ return;
+ }
+
+ if (state["expanded"]) {
+ this.__setExpandValue(state["expanded"]);
+ }
+
+ if (state["itemName"]) {
+ this.__rfPanelMenu().selectedItem(state["itemName"]);
+ }
+ },
+
+ __fireSwitch : function () {
+ return new rf.Event.fireById(this.id, "switch", {
+ id: this.id
+ });
+ },
+
+ __isMyEvent: function (event) {
+ return this.id == event.target.id;
+ },
+
+ __fireBeforeSwitch : function () {
+ return rf.Event.fireById(this.id, "beforeswitch", {
+ id: this.id
+ });
+ },
+
+ __fireCollapse : function () {
+ return new rf.Event.fireById(this.id, "collapse", {
+ id: this.id
+ });
+ },
+
+ __fireExpand : function () {
+ return new rf.Event.fireById(this.id, "expand", {
+ id: this.id
+ });
+ },
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "."+this.namespace);
+
+ this.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Added: trunk/examples/output-demo/src/main/webapp/resources/PanelMenuItem.js
===================================================================
--- trunk/examples/output-demo/src/main/webapp/resources/PanelMenuItem.js
(rev 0)
+++ trunk/examples/output-demo/src/main/webapp/resources/PanelMenuItem.js 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,283 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ disabled : false,
+ selectable: true,
+ mode: "client",
+ unselectable: false,
+ highlight: true,
+ stylePrefix: "rf-pm-itm"
+ };
+
+ var SELECT_ITEM = {
+
+ /**
+ *
+ * @return {void}
+ * */
+ exec : function (item) {
+ var mode = item.mode;
+ if (mode == "server") {
+ return this.execServer(item);
+ } else if (mode == "ajax") {
+ return this.execAjax(item);
+ } else if (mode == "client" || mode == "none") {
+ return this.execClient(item);
+ } else {
+ rf.log.error("SELECT_ITEM.exec : unknown mode (" + mode +
")");
+ }
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execServer : function (item) {
+ item.__changeState();
+ rf.submitForm(this.__getParentForm(item));
+
+ return false;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (item) {
+ var oldItem = item.__changeState();
+ rf.ajax(item.__panelMenu().id, null, $.extend({},
item.options["ajax"], {}));
+ item.__restoreState(oldItem);
+
+ return true;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (item) {
+ var panelMenu = item.__rfPanelMenu();
+ if (panelMenu.selectedItem()) {
+ panelMenu.getItems()[panelMenu.selectedItem()].unselect();
+ }
+ panelMenu.selectedItem(item.itemName);
+
+ item.__select();
+
+ return item.__fireSelect();
+ },
+
+ /**
+ * @private
+ * */
+ __getParentForm : function (item) {
+ return $($(rf.getDomElement(item.id)).parents("form")[0]);
+ }
+ };
+
+ rf.ui.PanelMenuItem = rf.BaseComponent.extendClass({
+ // class name
+ name:"PanelMenuItem",
+
+ /**
+ * @class PanelMenuItem
+ * @name PanelMenuItem
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ this.id = componentId;
+ this.attachToDom(componentId);
+
+ this.options = $.extend({}, __DEFAULT_OPTIONS, this.options || {}, options ||
{});
+
+ this.mode = this.options.mode
+ this.itemName = this.options.name
+ this.__rfPanelMenu().getItems()[this.itemName] = this;
+
+ // todo move it
+ this.selectionClass = this.options.stylePrefix + "-sel";
+ this.hoverClass = this.options.stylePrefix + "-hov";
+
+ if (!this.options.disabled) {
+ var item = this;
+ if (this.options.highlight) {
+ this.__item().bind("mouseenter", function() {
+ item.highlight(true);
+ });
+ this.__item().bind("mouseleave", function() {
+ item.highlight(false);
+ });
+ }
+
+ if (this.options.selectable) {
+ this.__header().bind("click", function() {
+ if (item.__rfPanelMenu().selectedItem() == item.id) {
+ if (item.options.unselectable) {
+ return item.unselect();
+ }
+
+ // we shouldn't select one item several times
+ } else {
+ return item.select();
+ }
+ });
+ }
+ }
+
+ this.__addUserEventHandler("select");
+ },
+
+ /***************************** Public Methods
****************************************************************/
+ highlight : function (highlight) {
+ if (highlight && !this.selected()) {
+ this.__header().addClass(this.hoverClass);
+ } else {
+ this.__header().removeClass(this.hoverClass);
+ }
+ },
+
+ selected : function () {
+ return this.__header().hasClass(this.selectionClass);
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuItem#select
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ select: function () {
+ var continueProcess = this.__fireBeforeSelect();
+ if (!continueProcess) {
+ return false;
+ }
+
+ return SELECT_ITEM.exec(this)
+ },
+
+ /**
+ * please, remove this method when client side ajax events will be added
+ *
+ * */
+ onCompleteHandler : function () {
+ SELECT_ITEM.execClient(this);
+ },
+
+ unselect: function () {
+ var panelMenu = this.__rfPanelMenu();
+ if (panelMenu.selectedItem() == this.itemName) {
+ panelMenu.selectedItem(null);
+ } else {
+ rf.warn("You try unselect item (name=" + this.itemName +
") that isn't seleted")
+ }
+
+ this.__unselect();
+
+ return this.__fireUnselect();
+ },
+
+ /***************************** Private Methods
****************************************************************/
+ __panelMenu : function () {
+ return this.__item().parents(".rf-pm")[0];
+ },
+
+ __rfPanelMenu : function () {
+ return rf.$(this.__item().parents(".rf-pm")[0]);
+ },
+
+ __changeState : function () {
+ return this.__rfPanelMenu().selectedItem(this.itemName);
+ },
+
+ __restoreState : function (state) {
+ if (state) {
+ this.__rfPanelMenu().selectedItem(state);
+ }
+ },
+
+ __item : function () {
+ return $(rf.getDomElement(this.id));
+ },
+
+ __header : function () {
+ return this.__item();
+ },
+
+ __select: function () {
+ this.__header().addClass(this.selectionClass);
+ },
+
+ __unselect: function () {
+ this.__header().removeClass(this.selectionClass);
+ },
+
+ __fireBeforeSelect : function () {
+ return new rf.Event.fireById(this.id, "beforeselect", {
+ id: this.id
+ });
+ },
+
+ __fireSelect : function () {
+ return new rf.Event.fireById(this.id, "select", {
+ id: this.id
+ });
+ },
+
+ __fireUnselect : function () {
+ return new rf.Event.fireById(this.id, "unselect", {
+ id: this.id
+ });
+ },
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ destroy: function () {
+ delete this.__rfPanelMenu().getItems()[this.itemName];
+
+ rf.ui.PanelMenuItem.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Added:
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js
===================================================================
---
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js
(rev 0)
+++
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+RichFaces.QUnit.run(function() {
+ module("richfaces-panel-menu-group");
+
+ var PANEL_MENU_GROUP_ID = "f:panelMenuGroup";
+
+ test("RichFaces.ui.PanelMenuGroup test constructor", function () {
+ var c = RichFaces.$(PANEL_MENU_GROUP_ID);
+
+ ok(c instanceof RichFaces.ui.PanelMenuGroup, "instance of
RichFaces.ui.PanelMenuGroup");
+ equals(c.id, PANEL_MENU_GROUP_ID, "id");
+
+ // test default options
+ same(c.options.expandEvent, "click", "Expand Event");
+ same(c.options.collapseEvent, "click", "Collapse Event");
+ same(c.options.expandSingle, false, "Expand Single");
+ same(c.options.bubbleSelection, {}, "Bubble Selection");
+
+ });
+
+ test("RichFaces.ui.PanelMenuGroup test public api", function () {
+ var c = RichFaces.$(PANEL_MENU_GROUP_ID);
+
+ var PUBLIC_API = ["collapsed", "expanded",
"collapse", "expand", "switch"];
+
+ for (var i in PUBLIC_API) {
+ var funcName = PUBLIC_API[i];
+ ok(c[funcName], funcName + "present in component");
+ equals(typeof c[funcName], "function", funcName + " is
function");
+ }
+ });
+
+ function testCollapseEvents(cancelEvent) {
+ var c = RichFaces.$(PANEL_MENU_GROUP_ID);
+
+ expect(cancelEvent ? 2 : 3);
+ var beforeCollapseHandler = function (event, comp, data) {
+ ok(true, "beforecollapse handler invoked");
+ same(data.id, PANEL_MENU_GROUP_ID, "Component Id");
+
+ return cancelEvent;
+ };
+ var beforeCollapseHandlerWrapper = RichFaces.Event.bindById(PANEL_MENU_GROUP_ID,
"beforecollapse", beforeCollapseHandler);
+
+ var collapseHandler = handler("collapse handler invoked", undefined);
+ var collapseHandlerWrapper = RichFaces.Event.bindById(PANEL_MENU_GROUP_ID,
"collapse", collapseHandler);
+
+ c.collapse();
+
+ RichFaces.Event.unbindById(PANEL_MENU_GROUP_ID, "beforecollapse",
beforeCollapseHandlerWrapper);
+ RichFaces.Event.unbindById(PANEL_MENU_GROUP_ID, "collapse",
collapseHandlerWrapper);
+
+ // TODO undo changes
+ }
+
+ test("RichFaces.ui.Tooltip.collapse test", function () {
+ testCollapseEvents(false);
+ });
+
+ test("RichFaces.ui.Tooltip.collapse test cancelable event", function () {
+ testCollapseEvents(true);
+ });
+
+ function testExpandEvents(cancelEvent) {
+ var c = RichFaces.$(PANEL_MENU_GROUP_ID);
+
+ expect(cancelEvent ? 2 : 3);
+ var beforeExpandHandler = function (event, comp, data) {
+ ok(true, "beforeexpand handler invoked");
+ same(data.id, PANEL_MENU_GROUP_ID, "Component Id");
+
+ return cancelEvent;
+ };
+ var beforeExpandHandlerWrapper = RichFaces.Event.bindById(PANEL_MENU_GROUP_ID,
"beforeexpand", beforeExpandHandler);
+
+ var expandHandler = handler("expand handler invoked", undefined);
+ var expandHandlerWrapper = RichFaces.Event.bindById(PANEL_MENU_GROUP_ID,
"expand", expandHandler);
+
+ c.expand();
+
+ RichFaces.Event.unbindById(PANEL_MENU_GROUP_ID, "beforeexpand",
beforeExpandHandlerWrapper);
+ RichFaces.Event.unbindById(PANEL_MENU_GROUP_ID, "expand",
expandHandlerWrapper);
+
+ // TODO undo changes
+ }
+
+ test("RichFaces.ui.Tooltip.expand test", function () {
+ testExpandEvents(false);
+ });
+
+ test("RichFaces.ui.Tooltip.expand test cancelable event", function () {
+ testExpandEvents(true);
+ });
+
+ function testSwitchEvents(cancelEvent) {
+ var c = RichFaces.$(PANEL_MENU_GROUP_ID);
+
+ expect(cancelEvent ? 2 : 3);
+ var beforeSwitchHandler = function (event, comp, data) {
+ ok(true, "beforeswitch handler invoked");
+ same(data.id, PANEL_MENU_GROUP_ID, "Component Id");
+
+ return cancelEvent;
+ };
+ var beforeSwitchHandlerWrapper = RichFaces.Event.bindById(PANEL_MENU_GROUP_ID,
"beforeswitch", beforeSwitchHandler);
+
+ var switchHandler = handler("switch handler invoked", undefined);
+ var switchHandlerWrapper = RichFaces.Event.bindById(PANEL_MENU_GROUP_ID,
"switch", switchHandler);
+
+ c.switch();
+
+ RichFaces.Event.unbindById(PANEL_MENU_GROUP_ID, "beforeswitch",
beforeSwitchHandlerWrapper);
+ RichFaces.Event.unbindById(PANEL_MENU_GROUP_ID, "switch",
switchHandlerWrapper);
+
+ // TODO undo changes
+ }
+
+ test("RichFaces.ui.Tooltip.switch test", function () {
+ testSwitchEvents(false);
+ });
+
+ test("RichFaces.ui.Tooltip.switch test cancelable event", function () {
+ testSwitchEvents(true);
+ });
+
+
+});
Added:
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-item-qunit.js
===================================================================
---
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-item-qunit.js
(rev 0)
+++
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-item-qunit.js 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+RichFaces.QUnit.run(function() {
+ module("richfaces-panel-menu-item");
+
+ var PANEL_MENU_ITEM_ID = "f:panelMenuItem";
+
+ test("RichFaces.ui.PanelMenuItem test constructor", function () {
+ var c = RichFaces.$(PANEL_MENU_ITEM_ID);
+
+ ok(c instanceof RichFaces.ui.PanelMenuItem, "instance of
RichFaces.ui.PanelMenuItem");
+ equals(c.id, PANEL_MENU_ITEM_ID, "id");
+
+ // test default options
+ same(c.options.disable, {}, "Disable");
+ same(c.options.mode, Richfaces.ui.PanelMenuMode.DEFAULT, "Mode");
+ same(c.options.selectable, {}, "Selectable");
+ same(c.options.unselectable, {}, "Unselectable");
+ same(c.options.highlight, {}, "Highlight");
+
+ });
+
+ test("RichFaces.ui.PanelMenuItem test public api", function () {
+ var c = RichFaces.$(PANEL_MENU_ITEM_ID);
+
+ var PUBLIC_API = ["selected", "unselect",
"select"];
+
+ for (var i in PUBLIC_API) {
+ var funcName = PUBLIC_API[i];
+ ok(c[funcName], funcName + "present in component");
+ equals(typeof c[funcName], "function", funcName + " is
function");
+ }
+ });
+
+ function testSelectEvents(cancelEvent) {
+ var c = RichFaces.$(PANEL_MENU_ITEM_ID);
+
+ expect(cancelEvent ? 2 : 3);
+ var beforeSelectHandler = function (event, comp, data) {
+ ok(true, "beforeselect handler invoked");
+ same(data.id, PANEL_MENU_ITEM_ID, "Component Id");
+
+ return cancelEvent;
+ };
+ var beforeSelectHandlerWrapper = RichFaces.Event.bindById(PANEL_MENU_ITEM_ID,
"beforeselect", beforeSelectHandler);
+
+ var selectHandler = handler("select handler invoked", undefined);
+ var selectHandlerWrapper = RichFaces.Event.bindById(PANEL_MENU_ITEM_ID,
"select", selectHandler);
+
+ c.select();
+
+ RichFaces.Event.unbindById(PANEL_MENU_ITEM_ID, "beforeselect",
beforeSelectHandlerWrapper);
+ RichFaces.Event.unbindById(PANEL_MENU_ITEM_ID, "select",
selectHandlerWrapper);
+
+ // TODO undo changes
+ }
+
+ test("RichFaces.ui.Tooltip.select test", function () {
+ testSelectEvents(false);
+ });
+
+ test("RichFaces.ui.Tooltip.select test cancelable event", function () {
+ testSelectEvents(true);
+ });
+
+
+});
Added:
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-qunit.js
===================================================================
---
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-qunit.js
(rev 0)
+++
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-qunit.js 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+RichFaces.QUnit.run(function() {
+ module("richfaces-panel-menu");
+
+ var PANEL_MENU_ID = "f:panelMenu";
+
+ test("RichFaces.ui.PanelMenu test constructor", function () {
+ var c = RichFaces.$(PANEL_MENU_ID);
+
+ ok(c instanceof RichFaces.ui.PanelMenu, "instance of
RichFaces.ui.PanelMenu");
+ equals(c.id, PANEL_MENU_ID, "id");
+
+ // test default options
+ same(c.options.disabled, false, "Disabled");
+ same(c.options.expandSingle, true, "Expand Single");
+ same(c.options.activeItem, null, "Active Item");
+
+ });
+
+ test("RichFaces.ui.PanelMenu test public api", function () {
+ var c = RichFaces.$(PANEL_MENU_ID);
+
+ var PUBLIC_API = ["selectItem", "selectedItem",
"expandAll", "collapseAll", "expandGroup",
"collapseGroup"];
+
+ for (var i in PUBLIC_API) {
+ var funcName = PUBLIC_API[i];
+ ok(c[funcName], funcName + "present in component");
+ equals(typeof c[funcName], "function", funcName + " is
function");
+ }
+ });
+
+
+});
Modified: trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-10-31
17:38:22 UTC (rev 19805)
+++ trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -13,9 +13,20 @@
</h:head>
<h:body>
+ <ui:insert name="scripts" ></ui:insert>
+ <h:form>
+ <h:commandButton value="Classic">
+ <f:setPropertyActionListener target="#{skinBean.skin}"
value="classic"/>
+ </h:commandButton>
+ <h:commandButton value="BlueSky">
+ <f:setPropertyActionListener target="#{skinBean.skin}"
value="blueSky"/>
+ </h:commandButton>
+ <h:commandButton value="DeepMarine">
+ <f:setPropertyActionListener target="#{skinBean.skin}"
value="deepMarine"/>
+ </h:commandButton>
+ </h:form>
- <ui:insert name="scripts" ></ui:insert>
<table width="100%">
<thead>
<tr>
@@ -29,85 +40,104 @@
<tr valign="top">
<td>
<h:form id="nav">
- <p>Examples</p>
- <ul>
- <li>
- <p>Toggle Panel</p>
- <ul>
- <li><h:commandLink
value="togglePanel" action="togglePanel" /></li>
- <li><h:commandLink value="togglePanel
Ajax" action="togglePanel/ajax" /></li>
- <li><h:commandLink value="togglePanel
Client" action="togglePanel/client" /></li>
- <li><h:commandLink value="togglePanel
Server" action="togglePanel/server" /></li>
- <li><h:commandLink value="togglePanel
Mixed" action="togglePanel/mixed" /></li>
- </ul>
- </li>
- <li>
- <p>Accordion</p>
- <ul>
- <li><h:commandLink
value="accordion" action="accordion" /></li>
- </ul>
- </li>
- <li>
- <p>Panel</p>
- <ul>
- <li><h:commandLink value="panel"
action="panel" /></li>
- </ul>
- </li>
- <li>
- <p>Popup panel</p>
- <ul>
- <li><h:commandLink value="popup"
action="popup" /></li>
- </ul>
- </li>
- <li>
- <p>ProgressBar</p>
- <ul>
- <li><h:commandLink
value="progressbar" action="progressbar" /></li>
- </ul>
- </li>
- <li>
- <p>Collapsible Panel</p>
- <ul>
- <li><h:commandLink value="Collapsible
Panel" action="collapsiblePanel" /></li>
- </ul>
- </li>
- <li>
- <p>Tab Panel</p>
- <ul>
- <li><h:commandLink value="Tab
Panel" action="tabPanel" /></li>
- </ul>
- </li>
- <li>
- <p>Tooltip</p>
- <ul>
- <li>
- <p>Examples</p>
- <ul>
- <li>
- <h:commandLink
value="Tooltip" action="tooltip"/>
- </li>
- </ul>
- <p>QUnit</p>
- <ul>
- <li>
- <h:commandLink
value="Tooltip" action="qunit/tooltip"/>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- <p>QUnit</p>
- <ul>
- <li><h:commandLink value="togglePanel"
action="qunit/togglePanel" /></li>
- <li><h:commandLink value="togglePanelItem"
action="qunit/togglePanelItem" /></li>
- <li><h:commandLink value="accordion"
action="qunit/accordion" /></li>
- <li><h:commandLink
value="accordionHeaders" action="qunit/accordionHeaders"
/></li>
- <li><h:commandLink
value="collapsiblePanel" action="qunit/collapsiblePanel"
/></li>
- <li><h:commandLink value="tabPanel"
action="qunit/tabPanel" /></li>
- </ul>
+ <p>Toggle Panel</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li><h:commandLink value="togglePanel"
action="togglePanel" /></li>
+ <li><h:commandLink value="togglePanel
Ajax" action="togglePanel/ajax" /></li>
+ <li><h:commandLink value="togglePanel
Client" action="togglePanel/client" /></li>
+ <li><h:commandLink value="togglePanel
Server" action="togglePanel/server" /></li>
+ <li><h:commandLink value="togglePanel
Mixed" action="togglePanel/mixed" /></li>
+ </ul>
+ <p>QUnit</p>
+ <ul>
+ <li><h:commandLink value="togglePanel"
action="qunit/togglePanel" /></li>
+ <li><h:commandLink
value="togglePanelItem" action="qunit/togglePanelItem"
/></li>
+ </ul>
+ </li>
+ </ul>
+
+
+ <p>Accordion</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li><h:commandLink value="accordion"
action="accordion" /></li>
+ </ul>
+ <p>QUnit</p>
+ <ul>
+ <li><h:commandLink value="accordion"
action="qunit/accordion" /></li>
+ <li><h:commandLink
value="accordionHeaders" action="qunit/accordionHeaders"
/></li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>Collapsible Panel</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li><h:commandLink value="Collapsible
Panel" action="collapsiblePanel" /></li>
+ </ul>
+ <p>QUnit</p>
+ <ul>
+ <li><h:commandLink value="tabPanel"
action="qunit/tabPanel" /></li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>Tab Panel</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li><h:commandLink value="Tab Panel"
action="tabPanel" /></li>
+ </ul>
+ <p>QUnit</p>
+ <ul>
+ <li><h:commandLink value="tabPanel"
action="qunit/tabPanel" /></li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>Panel Menu</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li><h:commandLink value="Panel Menu"
action="panelMenu" /></li>
+ </ul>
+ <p>QUnit</p>
+ <ul>
+ <li><h:commandLink value="Panel Menu"
action="qunit/panelMenu" /></li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>Tooltip</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li>
+ <h:commandLink value="Tooltip"
action="tooltip"/>
+ </li>
+ </ul>
+ <p>QUnit</p>
+ <ul>
+ <li>
+ <h:commandLink value="Tooltip"
action="qunit/tooltip"/>
+ </li>
+ </ul>
+ </li>
+ </ul>
+
</h:form>
</td>
+
<td>
<ui:insert name="body">Default
content</ui:insert>
</td>
Modified: trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
===================================================================
---
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-31
17:38:22 UTC (rev 19805)
+++
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-31
20:24:22 UTC (rev 19806)
@@ -39,7 +39,6 @@
rf.BaseComponent.extend(rf.ui.Popup);
var $super = rf.ui.Popup.$super;
-
var defaultOptions = {
visible: false
};
Added: trunk/ui/output/api/src/main/java/org/richfaces/ExpandMode.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/ExpandMode.java
(rev 0)
+++ trunk/ui/output/api/src/main/java/org/richfaces/ExpandMode.java 2010-10-31 20:24:22
UTC (rev 19806)
@@ -0,0 +1,35 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+/**
+ * @author akolonitsky
+ * @since Oct 19, 2010
+ */
+public enum ExpandMode {
+ ajax,
+ server,
+ client,
+ none;
+
+ public static final ExpandMode DEFAULT = client;
+}
Added: trunk/ui/output/api/src/main/java/org/richfaces/IconPosition.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/IconPosition.java
(rev 0)
+++ trunk/ui/output/api/src/main/java/org/richfaces/IconPosition.java 2010-10-31 20:24:22
UTC (rev 19806)
@@ -0,0 +1,13 @@
+package org.richfaces;
+
+/**
+ * @author akolonitsky
+ * @since Oct 19, 2010
+ */
+public enum IconPosition {
+ left,
+ right,
+ none;
+
+ public static final IconPosition DEFAULT = none;
+}
Added: trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
(rev 0)
+++ trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java 2010-10-31 20:24:22
UTC (rev 19806)
@@ -0,0 +1,12 @@
+package org.richfaces;
+
+/**
+ * @author akolonitsky
+ * @since Oct 19, 2010
+ */
+public enum PanelMenuMode {
+ ajax,
+ server;
+
+ public static final PanelMenuMode DEFAULT = server;
+}
Modified: trunk/ui/output/ui/checkstyle-suppressions.xml
===================================================================
--- trunk/ui/output/ui/checkstyle-suppressions.xml 2010-10-31 17:38:22 UTC (rev 19805)
+++ trunk/ui/output/ui/checkstyle-suppressions.xml 2010-10-31 20:24:22 UTC (rev 19806)
@@ -33,4 +33,5 @@
<!-- TODO it is hot fix for building process, this files belong to the
ui/output/trunk/panela/ui module,
and must be removed from here -->
<suppress checks="IllegalCatch"
files="AbstractTogglePanel.java" />
+ <suppress checks="IllegalCatch" files="AbstractPanelMenu.java"
/>
</suppressions>
Modified: trunk/ui/output/ui/richfaces-suppressions.xml
===================================================================
--- trunk/ui/output/ui/richfaces-suppressions.xml 2010-10-31 17:38:22 UTC (rev 19805)
+++ trunk/ui/output/ui/richfaces-suppressions.xml 2010-10-31 20:24:22 UTC (rev 19806)
@@ -6,4 +6,6 @@
<suppressions>
<suppress checks="IllegalCatch"
files="AbstractTogglePanel.java" />
+ <suppress checks="IllegalCatch" files="AbstractPanelMenu.java"
/>
+ <suppress checks="IllegalCatch"
files="AbstractPanelMenuGroup.java" />
</suppressions>
Added: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,216 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.richfaces.ExpandMode;
+import org.richfaces.PanelMenuMode;
+import org.richfaces.event.ItemChangeEvent;
+
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.context.FacesContext;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.PhaseId;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public abstract class AbstractPanelMenu extends UIOutput {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.PanelMenu";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.PanelMenu";
+
+ private String submittedActiveItem;
+
+ private enum PropertyKeys {
+ valid,
+ immediate
+ }
+
+ protected AbstractPanelMenu() {
+ setRendererType("org.richfaces.PanelMenu");
+ }
+
+ @Override
+ public void processDecodes(FacesContext context) {
+ super.processDecodes(context);
+
+ executeValidate(context);
+ }
+
+ public void validate(FacesContext context) {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Submitted value == null means "the component was not submitted at
all".
+ String activeItem = getSubmittedActiveItem();
+ if (activeItem == null) {
+ return;
+ }
+
+ String previous = (String) getValue();
+ setActiveItem(activeItem);
+ setSubmittedActiveItem(null);
+ if (previous != null && !previous.equalsIgnoreCase(activeItem)) {
+ queueEvent(new ItemChangeEvent(this, previous, activeItem));
+ }
+ }
+
+ private void executeValidate(FacesContext context) {
+ try {
+ validate(context);
+ } catch (RuntimeException e) {
+ context.renderResponse();
+ throw e;
+ }
+
+ if (!isValid()) {
+ context.validationFailed();
+ context.renderResponse();
+ }
+ }
+
+ @Override
+ public void queueEvent(FacesEvent event) {
+ if ((event instanceof ItemChangeEvent) && (event.getComponent() == this))
{
+ setEventPhase(event);
+ }
+
+ super.queueEvent(event);
+ }
+
+ protected void setEventPhase(FacesEvent event) {
+ if (isImmediate()) {
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else if (isBypassUpdates()) {
+ event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
+ } else {
+ event.setPhaseId(PhaseId.INVOKE_APPLICATION);
+ }
+ }
+
+
+
+ public String getSubmittedActiveItem() {
+ return this.submittedActiveItem;
+ }
+
+ public void setSubmittedActiveItem(Object submittedValue) {
+ this.submittedActiveItem = String.valueOf(submittedValue);
+ }
+
+ public boolean isValid() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.valid, true);
+ }
+
+ public void setValid(boolean valid) {
+ getStateHelper().put(PropertyKeys.valid, valid);
+ }
+
+ public String getActiveItem() {
+ return (String) getValue();
+ }
+
+ public void setActiveItem(String value) {
+ setValue(value);
+ }
+
+ @Override
+ public void setValueExpression(String name, ValueExpression binding) {
+ if ("activeItem".equals(name)) {
+ super.setValueExpression("value", binding);
+ } else {
+ super.setValueExpression(name, binding);
+ }
+ }
+
+ public boolean isImmediate() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.immediate, false);
+ }
+
+ public void setImmediate(boolean immediate) {
+ getStateHelper().put(PropertyKeys.immediate, immediate);
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public abstract boolean isDisabled();
+
+ public abstract String getExpandEvent();
+
+ public abstract String getCollapseEvent();
+
+ public abstract ExpandMode getGroupMode();
+
+ public abstract boolean isExpandSingle();
+
+ public abstract PanelMenuMode getItemMode();
+
+ public abstract boolean isBubbleSelection();
+
+ public abstract String getItemChangeListener();
+
+ public abstract boolean isBypassUpdates();
+
+ public abstract boolean isLimitToList();
+
+ public abstract Object getData();
+
+ public abstract String getStatus();
+
+ public abstract Object getExecute();
+
+ public abstract Object getRender();
+
+ public AbstractPanelMenuItem getItem(String itemName) {
+ if (itemName == null) {
+ throw new IllegalArgumentException("Icon name can't be null");
+ }
+
+ return getItem(itemName, this);
+ }
+
+ private static AbstractPanelMenuItem getItem(String itemName, UIComponent comp) {
+ if (comp instanceof AbstractPanelMenuItem
+ && itemName.equals(((AbstractPanelMenuItem) comp).getName())) {
+ return (AbstractPanelMenuItem) comp;
+ }
+
+ for (UIComponent item : comp.getChildren()) {
+ AbstractPanelMenuItem resItem = getItem(itemName, item);
+ if (resItem != null) {
+ return resItem;
+ }
+ }
+
+ return null;
+ }
+}
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.richfaces.event.ChangeExpandEvent;
+import org.richfaces.event.ItemChangeEvent;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.PhaseId;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public abstract class AbstractPanelMenuGroup extends UIPanelMenuItem {
+
+ public static final String COMPONENT_TYPE =
"org.richfaces.PanelMenuGroup";
+
+ public static final String COMPONENT_FAMILY =
"org.richfaces.PanelMenuGroup";
+ private Boolean submittedExpanded;
+
+ private enum PropertyKeys {
+ valid,
+ immediate
+ }
+
+ protected AbstractPanelMenuGroup() {
+ setRendererType("org.richfaces.PanelMenuGroup");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ @Override
+ public void processDecodes(FacesContext context) {
+ super.processDecodes(context);
+
+ executeValidate(context);
+ }
+
+ public void validate(FacesContext context) {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Submitted value == null means "the component was not submitted at
all".
+ Boolean expanded = getSubmittedExpanded();
+ if (expanded == null) {
+ return;
+ }
+
+ Boolean previous = (Boolean) getValue();
+ setExpanded(expanded);
+ setSubmittedExpanded(null);
+ if (previous != null && !previous.equals(expanded)) {
+ queueEvent(new ChangeExpandEvent(this, previous));
+ }
+ }
+
+ private void executeValidate(FacesContext context) {
+ try {
+ validate(context);
+ } catch (RuntimeException e) {
+ context.renderResponse();
+ throw e;
+ }
+
+ if (!isValid()) {
+ context.validationFailed();
+ context.renderResponse();
+ }
+ }
+
+ @Override
+ public void queueEvent(FacesEvent event) {
+ if ((event instanceof ItemChangeEvent) && (event.getComponent() == this))
{
+ setEventPhase(event);
+ }
+
+ super.queueEvent(event);
+ }
+
+ protected void setEventPhase(FacesEvent event) {
+ if (isImmediate()) {
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else if (isBypassUpdates()) {
+ event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
+ } else {
+ event.setPhaseId(PhaseId.INVOKE_APPLICATION);
+ }
+ }
+
+
+
+ public Boolean getSubmittedExpanded() {
+ return this.submittedExpanded;
+ }
+
+ public void setSubmittedExpanded(Object submittedValue) {
+ this.submittedExpanded = Boolean.parseBoolean(String.valueOf(submittedValue));
+ }
+
+ public boolean isValid() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.valid, true);
+ }
+
+ public void setValid(boolean valid) {
+ getStateHelper().put(PropertyKeys.valid, valid);
+ }
+
+ public boolean isExpanded() {
+ return getValue() == null ? false : (Boolean) getValue();
+ }
+
+ public void setExpanded(boolean expanded) {
+ setValue(expanded);
+ }
+
+ @Override
+ public void setValueExpression(String name, ValueExpression binding) {
+ if ("expanded".equals(name)) {
+ super.setValueExpression("value", binding);
+ } else {
+ super.setValueExpression(name, binding);
+ }
+ }
+
+ public boolean isImmediate() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.immediate, false);
+ }
+
+ public void setImmediate(boolean immediate) {
+ getStateHelper().put(PropertyKeys.immediate, immediate);
+ }
+
+
+
+
+ public abstract boolean getBubbleSelection();
+
+ public abstract boolean isExpandSingle();
+
+ public abstract String getCollapseEvent();
+
+ public abstract String getExpandEvent();
+
+ public abstract String getIconCollapsed();
+
+ public abstract String getIconExpanded();
+
+ public abstract String getChangeExpandListener();
+
+
+
+}
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.richfaces.PanelMenuMode;
+
+import javax.faces.component.UIOutput;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public abstract class AbstractPanelMenuItem extends UIOutput {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.PanelMenuItem";
+
+ public static final String COMPONENT_FAMILY =
"org.richfaces.PanelMenuItem";
+
+ protected AbstractPanelMenuItem() {
+ setRendererType("org.richfaces.PanelMenuItem");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public abstract String getIcon();
+
+ public abstract PanelMenuMode getMode();
+
+ public abstract String getLabel();
+
+ public abstract String getName();
+
+ public abstract boolean isDisabled();
+
+ public abstract boolean isBypassUpdates();
+
+ public abstract boolean isLimitToList();
+
+ public abstract Object getData();
+
+ public abstract String getStatus();
+
+ public abstract Object getExecute();
+
+ public abstract Object getRender();
+
+
+
+}
Added: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
(rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,165 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.richfaces.ExpandMode;
+import org.richfaces.PanelMenuMode;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class UIPanelMenu extends AbstractPanelMenu {
+
+ public enum PropertyKeys {
+ disabled,
+ expandEvent,
+ collapseEvent,
+ groupMode,
+ expandSingle,
+ itemMode,
+ bubbleSelection,
+ itemChangeListener,
+ bypassUpdates,
+ limitToList,
+ data,
+ status,
+ execute,
+ render
+ }
+
+ public boolean isDisabled() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.disabled)));
+ }
+
+ public void setDisabled(boolean disabled) {
+ getStateHelper().put(PropertyKeys.disabled, disabled);
+ }
+
+ public String getExpandEvent() {
+ return (String) getStateHelper().eval(PropertyKeys.expandEvent,
"click");
+ }
+
+ public void setExpandEvent(String expandEvent) {
+ getStateHelper().put(PropertyKeys.expandEvent, expandEvent);
+ }
+
+ public String getCollapseEvent() {
+ return (String) getStateHelper().eval(PropertyKeys.collapseEvent,
"click");
+ }
+
+ public void setCollapseEvent(String collapseEvent) {
+ getStateHelper().put(PropertyKeys.collapseEvent, collapseEvent);
+ }
+
+ public ExpandMode getGroupMode() {
+ return (ExpandMode) getStateHelper().eval(PropertyKeys.groupMode,
ExpandMode.DEFAULT);
+ }
+
+ public void setGroupMode(ExpandMode groupMode) {
+ getStateHelper().put(PropertyKeys.groupMode, groupMode);
+ }
+
+ public boolean isExpandSingle() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.expandSingle, true)));
+ }
+
+ public void setExpandSingle(boolean expandSingle) {
+ getStateHelper().put(PropertyKeys.expandSingle, expandSingle);
+ }
+
+ public PanelMenuMode getItemMode() {
+ return (PanelMenuMode) getStateHelper().eval(PropertyKeys.itemMode,
PanelMenuMode.DEFAULT);
+ }
+
+ public void setItemMode(PanelMenuMode itemMode) {
+ getStateHelper().put(PropertyKeys.itemMode, itemMode);
+ }
+
+ public boolean isBubbleSelection() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.bubbleSelection,
true)));
+ }
+
+ public void setBubbleSelection(boolean bubbleSelection) {
+ getStateHelper().put(PropertyKeys.bubbleSelection, bubbleSelection);
+ }
+
+ public String getItemChangeListener() {
+ return (String) getStateHelper().eval(PropertyKeys.itemChangeListener);
+ }
+
+ public void setItemChangeListener(String itemChangeListener) {
+ getStateHelper().put(PropertyKeys.itemChangeListener, itemChangeListener);
+ }
+
+ public boolean isBypassUpdates() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.bypassUpdates)));
+ }
+
+ public void setBypassUpdates(boolean bypassUpdates) {
+ getStateHelper().put(PropertyKeys.bypassUpdates, bypassUpdates);
+ }
+
+ public boolean isLimitToList() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.limitToList)));
+ }
+
+ public void setLimitToList(boolean limitToList) {
+ getStateHelper().put(PropertyKeys.limitToList, limitToList);
+ }
+
+ public Object getData() {
+ return getStateHelper().eval(PropertyKeys.data);
+ }
+
+ public void setData(Object data) {
+ getStateHelper().put(PropertyKeys.data, data);
+ }
+
+ public String getStatus() {
+ return (String) getStateHelper().eval(PropertyKeys.status);
+ }
+
+ public void setStatus(String status) {
+ getStateHelper().put(PropertyKeys.status, status);
+ }
+
+ public Object getExecute() {
+ return getStateHelper().eval(PropertyKeys.execute);
+ }
+
+ public void setExecute(Object execute) {
+ getStateHelper().put(PropertyKeys.execute, execute);
+ }
+
+ public Object getRender() {
+ return getStateHelper().eval(PropertyKeys.render);
+ }
+
+ public void setRender(Object render) {
+ getStateHelper().put(PropertyKeys.render, render);
+ }
+
+
+}
Added: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class UIPanelMenuGroup extends AbstractPanelMenuGroup {
+
+ public enum PropertyKeys {
+ bubbleSelection,
+ expanded,
+ expandSingle,
+ collapseEvent,
+ expandEvent,
+ iconCollapsed,
+ iconExpanded,
+ changeExpandListener
+ }
+
+
+
+ public boolean getBubbleSelection() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.bubbleSelection,
true)));
+ }
+
+ public void setBubbleSelection(boolean bubbleSelection) {
+ getStateHelper().put(PropertyKeys.bubbleSelection, bubbleSelection);
+ }
+
+ public boolean isExpandSingle() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.expandSingle, true)));
+ }
+
+ public void setExpandSingle(boolean expandSingle) {
+ getStateHelper().put(PropertyKeys.expandSingle, expandSingle);
+ }
+
+ public String getCollapseEvent() {
+ return (String) getStateHelper().eval(PropertyKeys.collapseEvent,
"click");
+ }
+
+ public void setCollapseEvent(String collapseEvent) {
+ getStateHelper().put(PropertyKeys.collapseEvent, collapseEvent);
+ }
+
+ public String getExpandEvent() {
+ return (String) getStateHelper().eval(PropertyKeys.expandEvent,
"click");
+ }
+
+ public void setExpandEvent(String expandEvent) {
+ getStateHelper().put(PropertyKeys.expandEvent, expandEvent);
+ }
+
+ public String getIconCollapsed() {
+ return (String) getStateHelper().eval(PropertyKeys.iconCollapsed);
+ }
+
+ public void setIconCollapsed(String iconCollapsed) {
+ getStateHelper().put(PropertyKeys.iconCollapsed, iconCollapsed);
+ }
+
+ public String getIconExpanded() {
+ return (String) getStateHelper().eval(PropertyKeys.iconExpanded);
+ }
+
+ public void setIconExpanded(String iconExpanded) {
+ getStateHelper().put(PropertyKeys.iconExpanded, iconExpanded);
+ }
+
+ public String getChangeExpandListener() {
+ return (String) getStateHelper().eval(PropertyKeys.changeExpandListener);
+ }
+
+ public void setChangeExpandListener(String changeExpandListener) {
+ getStateHelper().put(PropertyKeys.changeExpandListener, changeExpandListener);
+ }
+
+
+}
Added: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,137 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.richfaces.PanelMenuMode;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class UIPanelMenuItem extends AbstractPanelMenuItem {
+
+ public enum PropertyKeys {
+ icon,
+ mode,
+ label,
+ name,
+ disabled,
+ bypassUpdates,
+ limitToList,
+ data,
+ status,
+ execute,
+ render
+ }
+
+ public String getIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.icon);
+ }
+
+ public void setIcon(String icon) {
+ getStateHelper().put(PropertyKeys.icon, icon);
+ }
+
+ public PanelMenuMode getMode() {
+ return (PanelMenuMode) getStateHelper().eval(PropertyKeys.mode,
PanelMenuMode.DEFAULT);
+ }
+
+ public void setMode(PanelMenuMode mode) {
+ getStateHelper().put(PropertyKeys.mode, mode);
+ }
+
+ public String getLabel() {
+ return (String) getStateHelper().eval(PropertyKeys.label, getName());
+ }
+
+ public void setLabel(String label) {
+ getStateHelper().put(PropertyKeys.label, label);
+ }
+
+ public String getName() {
+ return (String) getStateHelper().eval(PropertyKeys.name, getId());
+ }
+
+ public void setName(String name) {
+ getStateHelper().put(PropertyKeys.name, name);
+ }
+
+ public boolean isDisabled() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.disabled)));
+ }
+
+ public void setDisabled(boolean disabled) {
+ getStateHelper().put(PropertyKeys.disabled, disabled);
+ }
+
+ public boolean isBypassUpdates() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.bypassUpdates)));
+ }
+
+ public void setBypassUpdates(boolean bypassUpdates) {
+ getStateHelper().put(PropertyKeys.bypassUpdates, bypassUpdates);
+ }
+
+ public boolean isLimitToList() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.limitToList)));
+ }
+
+ public void setLimitToList(boolean limitToList) {
+ getStateHelper().put(PropertyKeys.limitToList, limitToList);
+ }
+
+ public Object getData() {
+ return getStateHelper().eval(PropertyKeys.data);
+ }
+
+ public void setData(Object data) {
+ getStateHelper().put(PropertyKeys.data, data);
+ }
+
+ public String getStatus() {
+ return (String) getStateHelper().eval(PropertyKeys.status);
+ }
+
+ public void setStatus(String status) {
+ getStateHelper().put(PropertyKeys.status, status);
+ }
+
+ public Object getExecute() {
+ return getStateHelper().eval(PropertyKeys.execute);
+ }
+
+ public void setExecute(Object execute) {
+ getStateHelper().put(PropertyKeys.execute, execute);
+ }
+
+ public Object getRender() {
+ return getStateHelper().eval(PropertyKeys.render);
+ }
+
+ public void setRender(Object render) {
+ getStateHelper().put(PropertyKeys.render, render);
+ }
+
+
+}
Added: trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenu.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenu.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,397 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component.html;
+
+import org.richfaces.component.UIPanelMenu;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class HtmlPanelMenu extends UIPanelMenu implements ClientBehaviorHolder {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.PanelMenu";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.PanelMenu";
+
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(Arrays.asList(
+ "click",
+ "dblclick",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup"
+ ));
+
+
+ public enum PropertyKeys {
+ style,
+ styleClass,
+ width,
+ itemClass,
+ itemHoverClass,
+ itemDisableClass,
+ itemIcon,
+ itemDisableIcon,
+ itemIconPosition,
+ topItemClass,
+ topItemHoverClass,
+ topItemDisableClass,
+ topItemIcon,
+ topItemDisableIcon,
+ topItemIconPosition,
+ groupClass,
+ groupHoverClass,
+ groupDisableClass,
+ groupCollapseIcon,
+ groupExpandIcon,
+ groupDisableIcon,
+ groupIconPosition,
+ topGroupClass,
+ topGroupHoverClass,
+ topGroupDisableClass,
+ topGroupCollapseIcon,
+ topGroupExpandIcon,
+ topGroupDisableIcon,
+ topGroupIconPosition,
+ onclick,
+ ondblclick,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup
+ }
+
+ public HtmlPanelMenu() {
+ setRendererType("org.richfaces.PanelMenu");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style);
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass);
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public String getWidth() {
+ return (String) getStateHelper().eval(PropertyKeys.width);
+ }
+
+ public void setWidth(String width) {
+ getStateHelper().put(PropertyKeys.width, width);
+ }
+
+ public String getItemClass() {
+ return (String) getStateHelper().eval(PropertyKeys.itemClass);
+ }
+
+ public void setItemClass(String itemClass) {
+ getStateHelper().put(PropertyKeys.itemClass, itemClass);
+ }
+
+ public String getItemHoverClass() {
+ return (String) getStateHelper().eval(PropertyKeys.itemHoverClass);
+ }
+
+ public void setItemHoverClass(String itemHoverClass) {
+ getStateHelper().put(PropertyKeys.itemHoverClass, itemHoverClass);
+ }
+
+ public String getItemDisableClass() {
+ return (String) getStateHelper().eval(PropertyKeys.itemDisableClass);
+ }
+
+ public void setItemDisableClass(String itemDisableClass) {
+ getStateHelper().put(PropertyKeys.itemDisableClass, itemDisableClass);
+ }
+
+ public String getItemIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.itemIcon);
+ }
+
+ public void setItemIcon(String itemIcon) {
+ getStateHelper().put(PropertyKeys.itemIcon, itemIcon);
+ }
+
+ public String getItemDisableIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.itemDisableIcon);
+ }
+
+ public void setItemDisableIcon(String itemDisableIcon) {
+ getStateHelper().put(PropertyKeys.itemDisableIcon, itemDisableIcon);
+ }
+
+ public String getItemIconPosition() {
+ return (String) getStateHelper().eval(PropertyKeys.itemIconPosition);
+ }
+
+ public void setItemIconPosition(String itemIconPosition) {
+ getStateHelper().put(PropertyKeys.itemIconPosition, itemIconPosition);
+ }
+
+ public String getTopItemClass() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemClass);
+ }
+
+ public void setTopItemClass(String topItemClass) {
+ getStateHelper().put(PropertyKeys.topItemClass, topItemClass);
+ }
+
+ public String getTopItemHoverClass() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemHoverClass);
+ }
+
+ public void setTopItemHoverClass(String topItemHoverClass) {
+ getStateHelper().put(PropertyKeys.topItemHoverClass, topItemHoverClass);
+ }
+
+ public String getTopItemDisableClass() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemDisableClass);
+ }
+
+ public void setTopItemDisableClass(String topItemDisableClass) {
+ getStateHelper().put(PropertyKeys.topItemDisableClass, topItemDisableClass);
+ }
+
+ public String getTopItemIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemIcon);
+ }
+
+ public void setTopItemIcon(String topItemIcon) {
+ getStateHelper().put(PropertyKeys.topItemIcon, topItemIcon);
+ }
+
+ public String getTopItemDisableIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemDisableIcon);
+ }
+
+ public void setTopItemDisableIcon(String topItemDisableIcon) {
+ getStateHelper().put(PropertyKeys.topItemDisableIcon, topItemDisableIcon);
+ }
+
+ public String getTopItemIconPosition() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemIconPosition);
+ }
+
+ public void setTopItemIconPosition(String topItemIconPosition) {
+ getStateHelper().put(PropertyKeys.topItemIconPosition, topItemIconPosition);
+ }
+
+ public String getGroupClass() {
+ return (String) getStateHelper().eval(PropertyKeys.groupClass);
+ }
+
+ public void setGroupClass(String groupClass) {
+ getStateHelper().put(PropertyKeys.groupClass, groupClass);
+ }
+
+ public String getGroupHoverClass() {
+ return (String) getStateHelper().eval(PropertyKeys.groupHoverClass);
+ }
+
+ public void setGroupHoverClass(String groupHoverClass) {
+ getStateHelper().put(PropertyKeys.groupHoverClass, groupHoverClass);
+ }
+
+ public String getGroupDisableClass() {
+ return (String) getStateHelper().eval(PropertyKeys.groupDisableClass);
+ }
+
+ public void setGroupDisableClass(String groupDisableClass) {
+ getStateHelper().put(PropertyKeys.groupDisableClass, groupDisableClass);
+ }
+
+ public String getGroupCollapseIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.groupCollapseIcon);
+ }
+
+ public void setGroupCollapseIcon(String groupCollapseIcon) {
+ getStateHelper().put(PropertyKeys.groupCollapseIcon, groupCollapseIcon);
+ }
+
+ public String getGroupExpandIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.groupExpandIcon);
+ }
+
+ public void setGroupExpandIcon(String groupExpandIcon) {
+ getStateHelper().put(PropertyKeys.groupExpandIcon, groupExpandIcon);
+ }
+
+ public String getGroupDisableIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.groupDisableIcon);
+ }
+
+ public void setGroupDisableIcon(String groupDisableIcon) {
+ getStateHelper().put(PropertyKeys.groupDisableIcon, groupDisableIcon);
+ }
+
+ public String getGroupIconPosition() {
+ return (String) getStateHelper().eval(PropertyKeys.groupIconPosition);
+ }
+
+ public void setGroupIconPosition(String groupIconPosition) {
+ getStateHelper().put(PropertyKeys.groupIconPosition, groupIconPosition);
+ }
+
+ public String getTopGroupClass() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupClass);
+ }
+
+ public void setTopGroupClass(String topGroupClass) {
+ getStateHelper().put(PropertyKeys.topGroupClass, topGroupClass);
+ }
+
+ public String getTopGroupHoverClass() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupHoverClass);
+ }
+
+ public void setTopGroupHoverClass(String topGroupHoverClass) {
+ getStateHelper().put(PropertyKeys.topGroupHoverClass, topGroupHoverClass);
+ }
+
+ public String getTopGroupDisableClass() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupDisableClass);
+ }
+
+ public void setTopGroupDisableClass(String topGroupDisableClass) {
+ getStateHelper().put(PropertyKeys.topGroupDisableClass, topGroupDisableClass);
+ }
+
+ public String getTopGroupCollapseIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupCollapseIcon);
+ }
+
+ public void setTopGroupCollapseIcon(String topGroupCollapseIcon) {
+ getStateHelper().put(PropertyKeys.topGroupCollapseIcon, topGroupCollapseIcon);
+ }
+
+ public String getTopGroupExpandIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupExpandIcon);
+ }
+
+ public void setTopGroupExpandIcon(String topGroupExpandIcon) {
+ getStateHelper().put(PropertyKeys.topGroupExpandIcon, topGroupExpandIcon);
+ }
+
+ public String getTopGroupDisableIcon() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupDisableIcon);
+ }
+
+ public void setTopGroupDisableIcon(String topGroupDisableIcon) {
+ getStateHelper().put(PropertyKeys.topGroupDisableIcon, topGroupDisableIcon);
+ }
+
+ public String getTopGroupIconPosition() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupIconPosition);
+ }
+
+ public void setTopGroupIconPosition(String topGroupIconPosition) {
+ getStateHelper().put(PropertyKeys.topGroupIconPosition, topGroupIconPosition);
+ }
+
+ public String getOnclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onclick);
+ }
+
+ public void setOnclick(String onclick) {
+ getStateHelper().put(PropertyKeys.onclick, onclick);
+ }
+
+ public String getOndblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.ondblclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ getStateHelper().put(PropertyKeys.ondblclick, ondblclick);
+ }
+
+ public String getOnmousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousedown);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ getStateHelper().put(PropertyKeys.onmousedown, onmousedown);
+ }
+
+ public String getOnmousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousemove);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ getStateHelper().put(PropertyKeys.onmousemove, onmousemove);
+ }
+
+ public String getOnmouseout() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseout);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ getStateHelper().put(PropertyKeys.onmouseout, onmouseout);
+ }
+
+ public String getOnmouseover() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseover);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ getStateHelper().put(PropertyKeys.onmouseover, onmouseover);
+ }
+
+ public String getOnmouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseup);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ getStateHelper().put(PropertyKeys.onmouseup, onmouseup);
+ }
+
+
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+}
+
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuGroup.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuGroup.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component.html;
+
+import org.richfaces.component.UIPanelMenuGroup;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class HtmlPanelMenuGroup extends UIPanelMenuGroup implements ClientBehaviorHolder
{
+
+ public static final String COMPONENT_TYPE =
"org.richfaces.PanelMenuGroup";
+
+ public static final String COMPONENT_FAMILY =
"org.richfaces.PanelMenuGroup";
+
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(Arrays.asList(
+ "collapse",
+ "expand",
+ "switch",
+ "beforecollapse",
+ "beforeexpand",
+ "beforeswitch"
+ ));
+
+
+ public enum PropertyKeys {
+ oncollapse,
+ onexpand,
+ onswitch,
+ onbeforecollapse,
+ onbeforeexpand,
+ onbeforeswitch
+ }
+
+ public HtmlPanelMenuGroup() {
+ setRendererType("org.richfaces.PanelMenuGroup");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public String getOncollapse() {
+ return (String) getStateHelper().eval(PropertyKeys.oncollapse);
+ }
+
+ public void setOncollapse(String oncollapse) {
+ getStateHelper().put(PropertyKeys.oncollapse, oncollapse);
+ }
+
+ public String getOnexpand() {
+ return (String) getStateHelper().eval(PropertyKeys.onexpand);
+ }
+
+ public void setOnexpand(String onexpand) {
+ getStateHelper().put(PropertyKeys.onexpand, onexpand);
+ }
+
+ public String getOnswitch() {
+ return (String) getStateHelper().eval(PropertyKeys.onswitch);
+ }
+
+ public void setOnswitch(String onswitch) {
+ getStateHelper().put(PropertyKeys.onswitch, onswitch);
+ }
+
+ public String getOnbeforecollapse() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforecollapse);
+ }
+
+ public void setOnbeforecollapse(String onbeforecollapse) {
+ getStateHelper().put(PropertyKeys.onbeforecollapse, onbeforecollapse);
+ }
+
+ public String getOnbeforeexpand() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforeexpand);
+ }
+
+ public void setOnbeforeexpand(String onbeforeexpand) {
+ getStateHelper().put(PropertyKeys.onbeforeexpand, onbeforeexpand);
+ }
+
+ public String getOnbeforeswitch() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforeswitch);
+ }
+
+ public void setOnbeforeswitch(String onbeforeswitch) {
+ getStateHelper().put(PropertyKeys.onbeforeswitch, onbeforeswitch);
+ }
+
+
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+}
+
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuItem.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuItem.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,267 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component.html;
+
+import org.richfaces.component.UIPanelMenuItem;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class HtmlPanelMenuItem extends UIPanelMenuItem implements ClientBehaviorHolder {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.PanelMenuItem";
+
+ public static final String COMPONENT_FAMILY =
"org.richfaces.PanelMenuItem";
+
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(Arrays.asList(
+ "beforedomupdate",
+ "complete",
+ "click",
+ "dblclick",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup",
+ "unselect",
+ "select",
+ "beforeselect"
+ ));
+
+
+ public enum PropertyKeys {
+ disabledClass,
+ disabledStyle,
+ hoverClass,
+ hoverStyle,
+ iconClass,
+ iconDisabled,
+ iconStyle,
+ style,
+ styleClass,
+ onbeforedomupdate,
+ oncomplete,
+ onclick,
+ ondblclick,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup,
+ onunselect,
+ onselect,
+ onbeforeselect
+ }
+
+ public HtmlPanelMenuItem() {
+ setRendererType("org.richfaces.PanelMenuItem");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public String getDisabledClass() {
+ return (String) getStateHelper().eval(PropertyKeys.disabledClass);
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ getStateHelper().put(PropertyKeys.disabledClass, disabledClass);
+ }
+
+ public String getDisabledStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.disabledStyle);
+ }
+
+ public void setDisabledStyle(String disabledStyle) {
+ getStateHelper().put(PropertyKeys.disabledStyle, disabledStyle);
+ }
+
+ public String getHoverClass() {
+ return (String) getStateHelper().eval(PropertyKeys.hoverClass);
+ }
+
+ public void setHoverClass(String hoverClass) {
+ getStateHelper().put(PropertyKeys.hoverClass, hoverClass);
+ }
+
+ public String getHoverStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.hoverStyle);
+ }
+
+ public void setHoverStyle(String hoverStyle) {
+ getStateHelper().put(PropertyKeys.hoverStyle, hoverStyle);
+ }
+
+ public String getIconClass() {
+ return (String) getStateHelper().eval(PropertyKeys.iconClass);
+ }
+
+ public void setIconClass(String iconClass) {
+ getStateHelper().put(PropertyKeys.iconClass, iconClass);
+ }
+
+ public String getIconDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.iconDisabled);
+ }
+
+ public void setIconDisabled(String iconDisabled) {
+ getStateHelper().put(PropertyKeys.iconDisabled, iconDisabled);
+ }
+
+ public String getIconStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.iconStyle);
+ }
+
+ public void setIconStyle(String iconStyle) {
+ getStateHelper().put(PropertyKeys.iconStyle, iconStyle);
+ }
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style);
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass);
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public String getOnbeforedomupdate() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforedomupdate);
+ }
+
+ public void setOnbeforedomupdate(String onbeforedomupdate) {
+ getStateHelper().put(PropertyKeys.onbeforedomupdate, onbeforedomupdate);
+ }
+
+ public String getOncomplete() {
+ return (String) getStateHelper().eval(PropertyKeys.oncomplete);
+ }
+
+ public void setOncomplete(String oncomplete) {
+ getStateHelper().put(PropertyKeys.oncomplete, oncomplete);
+ }
+
+ public String getOnclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onclick);
+ }
+
+ public void setOnclick(String onclick) {
+ getStateHelper().put(PropertyKeys.onclick, onclick);
+ }
+
+ public String getOndblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.ondblclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ getStateHelper().put(PropertyKeys.ondblclick, ondblclick);
+ }
+
+ public String getOnmousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousedown);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ getStateHelper().put(PropertyKeys.onmousedown, onmousedown);
+ }
+
+ public String getOnmousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousemove);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ getStateHelper().put(PropertyKeys.onmousemove, onmousemove);
+ }
+
+ public String getOnmouseout() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseout);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ getStateHelper().put(PropertyKeys.onmouseout, onmouseout);
+ }
+
+ public String getOnmouseover() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseover);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ getStateHelper().put(PropertyKeys.onmouseover, onmouseover);
+ }
+
+ public String getOnmouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseup);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ getStateHelper().put(PropertyKeys.onmouseup, onmouseup);
+ }
+
+ public String getOnunselect() {
+ return (String) getStateHelper().eval(PropertyKeys.onunselect);
+ }
+
+ public void setOnunselect(String onunselect) {
+ getStateHelper().put(PropertyKeys.onunselect, onunselect);
+ }
+
+ public String getOnselect() {
+ return (String) getStateHelper().eval(PropertyKeys.onselect);
+ }
+
+ public void setOnselect(String onselect) {
+ getStateHelper().put(PropertyKeys.onselect, onselect);
+ }
+
+ public String getOnbeforeselect() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforeselect);
+ }
+
+ public void setOnbeforeselect(String onbeforeselect) {
+ getStateHelper().put(PropertyKeys.onbeforeselect, onbeforeselect);
+ }
+
+
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+}
+
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java 2010-10-31
17:38:22 UTC (rev 19805)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -22,21 +22,20 @@
package org.richfaces.component.html;
+import org.richfaces.component.UITogglePanelTitledItem;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-
-import org.richfaces.component.UITogglePanelTitledItem;
-
/**
* @author akolonitsky
- * @since 2010-08-27
+ * @since 2010-10-19
*/
public class HtmlTab extends UITogglePanelTitledItem implements ClientBehaviorHolder {
- public static final String COMPONENT_TYPE = "org.richfaces.TabPanelItem";
+ public static final String COMPONENT_TYPE =
"org.richfaces.TogglePanelTitledItem";
public static final String COMPONENT_FAMILY =
"org.richfaces.TogglePanelTitledItem";
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,171 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.renderkit.html;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractPanelMenuGroup;
+import org.richfaces.component.html.HtmlPanelMenuGroup;
+import org.richfaces.renderkit.HtmlConstants;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class PanelMenuGroupRenderer extends DivPanelRenderer {
+
+ public static final String COLLAPSE = "collapse";
+ public static final String EXPAND = "expand";
+ public static final String SWITCH = "switch";
+ public static final String BEFORE_COLLAPSE = "beforecollapse";
+ public static final String BEFORE_EXPAND = "beforeexpand";
+ public static final String BEFORE_SWITCH = "beforeswitch";
+
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ AbstractPanelMenuGroup menuGroup = (AbstractPanelMenuGroup) component;
+
+ Map<String, String> requestMap =
+ context.getExternalContext().getRequestParameterMap();
+
+ // Don't overwrite the value unless you have to!
+ String newValue = requestMap.get(component.getClientId() +
":expanded");
+ if (newValue != null) {
+ menuGroup.setSubmittedExpanded(newValue);
+ }
+
+ String compClientId = component.getClientId(context);
+ String clientId = requestMap.get(compClientId);
+ if (clientId != null && clientId.equals(compClientId)) {
+ context.getPartialViewContext().getRenderIds().add(clientId);
+
+ //TODO nick - this should be done on encode, not on decode
+ addOnCompleteParam(clientId);
+ }
+ }
+
+ protected static void addOnCompleteParam(String itemId) {
+ AjaxContext.getCurrentInstance().appendOncomplete(new StringBuilder()
+
.append("RichFaces.$('").append(itemId).append("').onCompleteHandler();").toString());
+ }
+
+
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ super.doEncodeBegin(writer, context, component);
+
+ HtmlPanelMenuGroup menuGroup = (HtmlPanelMenuGroup) component;
+
+ writer.startElement(HtmlConstants.INPUT_ELEM, component);
+
+ final String expanded = component.getClientId(context) + ":expanded";
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, expanded, null);
+ writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE, expanded, null);
+ writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.INPUT_TYPE_HIDDEN,
null);
+ writer.writeAttribute(HtmlConstants.VALUE_ATTRIBUTE,
String.valueOf(menuGroup.isExpanded()), null);
+ writer.endElement(HtmlConstants.INPUT_ELEM);
+
+ encodeHeader(writer, context, menuGroup);
+ encodeContentBegin(writer, context, menuGroup);
+ }
+
+ private void encodeHeader(ResponseWriter writer, FacesContext context,
HtmlPanelMenuGroup menuGroup) throws IOException {
+ writer.startElement("div", null);
+ writer.writeAttribute("id", menuGroup.getClientId(context) +
":hdr", null);
+ writer.writeAttribute("class", "rf-pm-gr-hdr", null);
+ writer.writeText(menuGroup.getLabel(), null);
+ writer.endElement("div");
+ }
+
+ private void encodeContentBegin(ResponseWriter writer, FacesContext context,
HtmlPanelMenuGroup menuGroup) throws IOException {
+ writer.startElement("div", null);
+ writer.writeAttribute("id", menuGroup.getClientId(context) +
":cnt", null);
+ writer.writeAttribute("class", concatClasses("rf-pm-gr-cnt",
menuGroup.isExpanded() ? "rf-pm-exp" : "rf-pm-colps"), null);
+ }
+
+ private void encodeContentEnd(ResponseWriter writer, FacesContext context,
UIComponent component) throws IOException {
+ writer.endElement("div");
+ }
+
+ @Override
+ protected String getStyleClass(UIComponent component) {
+ return concatClasses("rf-pm-gr", attributeAsString(component,
"styleClass"));
+ }
+
+ @Override
+ protected JSObject getScriptObject(FacesContext context, UIComponent component) {
+ return new JSObject("RichFaces.ui.PanelMenuGroup",
+ component.getClientId(), getScriptObjectOptions(context, component));
+ }
+
+ @Override
+ protected Map<String, Object> getScriptObjectOptions(FacesContext context,
UIComponent component) {
+ HtmlPanelMenuGroup panelMenuGroup = (HtmlPanelMenuGroup) component;
+
+ Map<String, Object> options = new HashMap<String, Object>();
+ options.put("ajax", getAjaxOptions(context, panelMenuGroup));
+ options.put("name", panelMenuGroup.getName());
+ options.put("mode", panelMenuGroup.getMode());
+ options.put("expandEvent", panelMenuGroup.getExpandEvent());
+ options.put("collapseEvent", panelMenuGroup.getCollapseEvent());
+ options.put("expandSingle", panelMenuGroup.isExpandSingle());
+ options.put("bubbleSelection", panelMenuGroup.getBubbleSelection());
+ options.put("expanded", panelMenuGroup.isExpanded());
+
+ addEventOption(context, panelMenuGroup, options, COLLAPSE);
+ addEventOption(context, panelMenuGroup, options, EXPAND);
+ addEventOption(context, panelMenuGroup, options, SWITCH);
+ addEventOption(context, panelMenuGroup, options, BEFORE_COLLAPSE);
+ addEventOption(context, panelMenuGroup, options, BEFORE_EXPAND);
+ addEventOption(context, panelMenuGroup, options, BEFORE_SWITCH);
+
+ return options;
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ encodeContentEnd(writer, context, component);
+
+ super.doEncodeEnd(writer, context, component);
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractPanelMenuGroup.class;
+ }
+}
+
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.renderkit.html;
+
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractPanelMenuItem;
+import org.richfaces.component.html.HtmlPanelMenuItem;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class PanelMenuItemRenderer extends DivPanelRenderer {
+
+ public static final String UNSELECT = "unselect";
+ public static final String SELECT = "select";
+ public static final String BEFORE_SELECT = "beforeselect";
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ super.doEncodeBegin(writer, context, component);
+
+ writer.writeText(((AbstractPanelMenuItem) component).getLabel(), null);
+ }
+
+ @Override
+ protected String getStyleClass(UIComponent component) {
+ return concatClasses("rf-pm-itm", attributeAsString(component,
"styleClass"));
+ }
+
+ @Override
+ protected JSObject getScriptObject(FacesContext context, UIComponent component) {
+ return new JSObject("RichFaces.ui.PanelMenuItem",
+ component.getClientId(), getScriptObjectOptions(context, component));
+ }
+
+ @Override
+ protected Map<String, Object> getScriptObjectOptions(FacesContext context,
UIComponent component) {
+ HtmlPanelMenuItem panelMenuItem = (HtmlPanelMenuItem) component;
+
+ Map<String, Object> options = new HashMap<String, Object>();
+ options.put("ajax", getAjaxOptions(context, panelMenuItem));
+ options.put("disabled", panelMenuItem.isDisabled());
+ options.put("mode", panelMenuItem.getMode());
+ options.put("name", panelMenuItem.getName());
+
+ addEventOption(context, panelMenuItem, options, UNSELECT);
+ addEventOption(context, panelMenuItem, options, SELECT);
+ addEventOption(context, panelMenuItem, options, BEFORE_SELECT);
+
+ return options;
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ super.doEncodeEnd(writer, context, component);
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractPanelMenuItem.class;
+ }
+}
+
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.renderkit.html;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractPanelMenu;
+import org.richfaces.component.AbstractPanelMenuItem;
+import org.richfaces.component.html.HtmlPanelMenu;
+import org.richfaces.renderkit.HtmlConstants;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+@ResourceDependencies( { // TODO review
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"PanelMenu.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"PanelMenuItem.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"PanelMenuGroup.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"panelMenu.ecss") })
+public class PanelMenuRenderer extends DivPanelRenderer {
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ AbstractPanelMenu panelMenu = (AbstractPanelMenu) component;
+
+ Map<String, String> requestMap =
+ context.getExternalContext().getRequestParameterMap();
+
+ // Don't overwrite the value unless you have to!
+ String newValue = requestMap.get(getValueRequestParamName(context, component));
+ if (newValue != null) {
+ panelMenu.setSubmittedActiveItem(newValue);
+ }
+
+ String compClientId = component.getClientId(context);
+ String clientId = requestMap.get(compClientId);
+ if (clientId != null && clientId.equals(compClientId)) {
+ AbstractPanelMenuItem panelItem = panelMenu.getItem(newValue);
+ if (panelItem != null) {
+
context.getPartialViewContext().getRenderIds().add(panelItem.getClientId(context));
+
+ //TODO nick - this should be done on encode, not on decode
+ addOnCompleteParam(panelItem.getClientId(context));
+ }
+ }
+ }
+
+ protected static void addOnCompleteParam(String itemId) {
+ AjaxContext.getCurrentInstance().appendOncomplete(new StringBuilder()
+
.append("RichFaces.$('").append(itemId).append("').onCompleteHandler();").toString());
+ }
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ super.doEncodeBegin(writer, context, component);
+
+ AbstractPanelMenu panelMenu = (AbstractPanelMenu) component;
+
+ writer.startElement(HtmlConstants.INPUT_ELEM, component);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE,
getValueRequestParamName(context, component), null);
+ writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE,
getValueRequestParamName(context, component), null);
+ writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.INPUT_TYPE_HIDDEN,
null);
+ writer.writeAttribute(HtmlConstants.VALUE_ATTRIBUTE, panelMenu.getActiveItem(),
null);
+ writer.endElement(HtmlConstants.INPUT_ELEM);
+
+ writeJavaScript(writer, context, component);
+ }
+
+ @Override
+ protected String getStyleClass(UIComponent component) {
+ return concatClasses("rf-pm", attributeAsString(component,
"styleClass"));
+ }
+
+ @Override
+ protected JSObject getScriptObject(FacesContext context, UIComponent component) {
+ return new JSObject("RichFaces.ui.PanelMenu",
+ component.getClientId(), getScriptObjectOptions(context, component));
+ }
+
+ @Override
+ protected Map<String, Object> getScriptObjectOptions(FacesContext context,
UIComponent component) {
+ HtmlPanelMenu panelMenu = (HtmlPanelMenu) component;
+
+ Map<String, Object> options = new HashMap<String, Object>();
+ options.put("ajax", getAjaxOptions(context, panelMenu));
+ options.put("disabled", panelMenu.isDisabled());
+ options.put("expandSingle", panelMenu.isExpandSingle());
+
+ return options;
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ writer.endElement(HtmlConstants.DIV_ELEM);
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractPanelMenu.class;
+ }
+}
+
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-31 17:38:22
UTC (rev 19805)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-31 20:24:22
UTC (rev 19806)
@@ -769,6 +769,186 @@
<component-class>org.richfaces.component.html.HtmlTab</component-class>
</component>
+ <component>
+ <component-type>org.richfaces.PanelMenuItem</component-type>
+
<component-class>org.richfaces.component.html.HtmlPanelMenuItem</component-class>
+ <property>
+ <description></description>
+ <property-name>icon</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>mode</property-name>
+ <property-class>org.richfaces.PanelMenuMode</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>label</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>name</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>disabled</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>bypassUpdates</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>limitToList</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>data</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>status</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>execute</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>render</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+
+ </component>
+ <component>
+ <component-type>org.richfaces.PanelMenuGroup</component-type>
+
<component-class>org.richfaces.component.html.HtmlPanelMenuGroup</component-class>
+ <property>
+ <description></description>
+ <property-name>expanded</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>expandSingle</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>collapseEvent</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>expandEvent</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>iconCollapsed</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>iconExpanded</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>changeExpandListener</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+
+ </component>
+ <component>
+ <component-type>org.richfaces.PanelMenu</component-type>
+
<component-class>org.richfaces.component.html.HtmlPanelMenu</component-class>
+ <property>
+ <description></description>
+ <property-name>disabled</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>expandEvent</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>collapseEvent</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>groupMode</property-name>
+ <property-class>org.richfaces.ExpandMode</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>expandSingle</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>itemMode</property-name>
+ <property-class>org.richfaces.PanelMenuMode</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>bubbleSelection</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>activeItem</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>itemChangeListener</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>bypassUpdates</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>limitToList</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>data</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>status</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>execute</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>render</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ </component>
+
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
<renderer>
@@ -839,6 +1019,22 @@
</renderer-extension>
</renderer>
+ <renderer>
+ <component-family>org.richfaces.PanelMenuItem</component-family>
+ <renderer-type>org.richfaces.PanelMenuItem</renderer-type>
+
<renderer-class>org.richfaces.renderkit.html.PanelMenuItemRenderer</renderer-class>
+ </renderer>
+ <renderer>
+
<component-family>org.richfaces.PanelMenuGroup</component-family>
+ <renderer-type>org.richfaces.PanelMenuGroup</renderer-type>
+
<renderer-class>org.richfaces.renderkit.html.PanelMenuGroupRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.PanelMenu</component-family>
+ <renderer-type>org.richfaces.PanelMenu</renderer-type>
+
<renderer-class>org.richfaces.renderkit.html.PanelMenuRenderer</renderer-class>
+ </renderer>
+
<client-behavior-renderer>
<client-behavior-renderer-type>org.richfaces.component.behavior.ToggleControl</client-behavior-renderer-type>
<client-behavior-renderer-class>org.richfaces.renderkit.html.ToggleControlRenderer</client-behavior-renderer-class>
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-31 17:38:22 UTC
(rev 19805)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-31 20:24:22 UTC
(rev 19806)
@@ -50,8 +50,615 @@
</component>
</tag>
+ <tag>
+ <tag-name>panelMenuItem</tag-name>
+ <component>
+ <component-type>org.richfaces.PanelMenuItem</component-type>
+ <renderer-type>org.richfaces.PanelMenuItem</renderer-type>
+ </component>
+ <attribute>
+ <description></description>
+ <name>icon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>mode</name>
+ <type>org.richfaces.PanelMenuMode</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>label</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>disabled</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>bypassUpdates</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>limitToList</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>data</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>status</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>execute</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>render</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>disabledClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>disabledStyle</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>hoverClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>hoverStyle</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>iconClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>iconDisabled</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>iconStyle</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onbeforedomupdate</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>oncomplete</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onunselect</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onselect</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onbeforeselect</name>
+ <type>java.lang.String</type>
+ </attribute>
+
+ </tag>
<tag>
+ <tag-name>panelMenuGroup</tag-name>
+ <component>
+ <component-type>org.richfaces.PanelMenuGroup</component-type>
+ <renderer-type>org.richfaces.PanelMenuGroup</renderer-type>
+
+ </component>
+ <attribute>
+ <description></description>
+ <name>expanded</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>expandSingle</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>collapseEvent</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>expandEvent</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>iconCollapsed</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>iconExpanded</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>changeExpandListener</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>icon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>mode</name>
+ <type>org.richfaces.PanelMenuMode</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>label</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>disabled</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>bypassUpdates</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>limitToList</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>data</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>status</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>execute</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>render</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>oncollapse</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onexpand</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onswitch</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onbeforecollapse</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onbeforeexpand</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onbeforeswitch</name>
+ <type>java.lang.String</type>
+ </attribute>
+
+ </tag>
+ <tag>
+ <tag-name>panelMenu</tag-name>
+ <component>
+ <component-type>org.richfaces.PanelMenu</component-type>
+ <renderer-type>org.richfaces.PanelMenu</renderer-type>
+
+ </component>
+ <attribute>
+ <description></description>
+ <name>disabled</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>expandEvent</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>collapseEvent</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>groupMode</name>
+ <type>org.richfaces.ExpandMode</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>expandSingle</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>itemMode</name>
+ <type>org.richfaces.PanelMenuMode</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>bubbleSelection</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>activeItem</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>itemChangeListener</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>bypassUpdates</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>limitToList</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>data</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>status</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>execute</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>render</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>width</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>itemClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>itemHoverClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>itemDisableClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>itemIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>itemDisableIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>itemIconPosition</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topItemClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topItemHoverClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topItemDisableClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topItemIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topItemDisableIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topItemIconPosition</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>groupClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>groupHoverClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>groupDisableClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>groupCollapseIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>groupExpandIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>groupDisableIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>groupIconPosition</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topGroupClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topGroupHoverClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topGroupDisableClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topGroupCollapseIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topGroupExpandIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topGroupDisableIcon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topGroupIconPosition</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+
+ </tag>
+
+ <tag>
<tag-name>tooltip</tag-name>
<component>
<component-type>org.richfaces.Tooltip</component-type>
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js 2010-10-31
17:38:22 UTC (rev 19805)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js 2010-10-31
20:24:22 UTC (rev 19806)
@@ -42,7 +42,7 @@
this.getTogglePanel().getItems()[this.index] = this;
//TODO - optimize this
- rf.Event.bindById(this.id + ":header:active", "click",
this.__onHeaderClick, this)
+ rf.Event.bindById(this.id + ":header:active", "click",
this.__onHeaderClick, this);
rf.Event.bindById(this.id + ":header:inactive", "click",
this.__onHeaderClick, this)
},
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js 2010-10-31
17:38:22 UTC (rev 19805)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js 2010-10-31
20:24:22 UTC (rev 19806)
@@ -111,9 +111,7 @@
// class stuff
destroy: function () {
- // rf.Event.unbindById(this.options.buttonId,
"."+this.namespace);
- // rf.Event.unbindById(this.componentId,
"."+this.namespace);
- // $super.destroy.call(this);
+ rf.ui.TogglePanelItem.$super.destroy.call(this);
}
});
})(jQuery, RichFaces);
Added:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+.rf-pm {
+ border:1px solid red;
+ padding:10px;
+}
+
+.rf-pm-itm {
+ border:1px solid #ffd700;
+}
+
+.rf-pm-itm-hov {
+ background-color:#ffd700;
+}
+
+.rf-pm-itm-sel {
+ background-color:blue;
+ color:#f5f5f5;
+}
+
+.rf-pm-gr {
+
+}
+
+.rf-pm-gr-hov {
+ background-color:green;
+ color:white;
+}
+
+.rf-pm-gr-sel {
+ background-color:blue;
+ color:#f5f5f5;
+}
+
+.rf-pm-gr-hdr {
+ border:1px solid green;
+ padding:2px;
+}
+
+.rf-pm-gr-cnt {
+ border:1px solid yellow;
+ padding:2px;
+ margin-left: 10px;
+}
+
+.rf-pm-colps {
+ display : none;
+}
+
+.rf-pm-exp {
+ display : block;
+}
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuGroupTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuGroupTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuGroupTest.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class UIPanelMenuGroupTest {
+
+ private UIPanelMenuGroup panelMenuGroup;
+
+ @Before
+ public void setUp () {
+ panelMenuGroup = new UIPanelMenuGroup();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(panelMenuGroup);
+ }
+}
+
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuItemTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuItemTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuItemTest.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class UIPanelMenuItemTest {
+
+ private UIPanelMenuItem panelMenuItem;
+
+ @Before
+ public void setUp () {
+ panelMenuItem = new UIPanelMenuItem();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(panelMenuItem);
+ }
+}
+
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIPanelMenuTest.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class UIPanelMenuTest {
+
+ private UIPanelMenu panelMenu;
+
+ @Before
+ public void setUp () {
+ panelMenu = new UIPanelMenu();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(panelMenu);
+ }
+}
+
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTest.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since 2010-10-19
+ */
+public class UITogglePanelTest {
+
+ private UITogglePanel togglePanel;
+
+ @Before
+ public void setUp () {
+ togglePanel = new UITogglePanel();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(togglePanel);
+ }
+}
+
Modified:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java 2010-10-31
17:38:22 UTC (rev 19805)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -34,17 +34,7 @@
* @since Oct 22, 2010
*/
public class IgnoreScriptsContent implements DifferenceListener {
- private static final int[] IGNORE = new int[] {
- DifferenceConstants.HAS_DOCTYPE_DECLARATION_ID,
- DifferenceConstants.DOCTYPE_NAME_ID,
- DifferenceConstants.DOCTYPE_PUBLIC_ID_ID,
- DifferenceConstants.DOCTYPE_SYSTEM_ID_ID
- };
- static {
- Arrays.sort(IGNORE);
- }
-
public int differenceFound(Difference difference) {
if (DifferenceConstants.TEXT_VALUE_ID == difference.getId()
&&
!"script".equalsIgnoreCase(difference.getTestNodeDetail().getNode().getLocalName()))
{
Added:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuGroupRendererTest.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuGroupRendererTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuGroupRendererTest.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.renderkit.html;
+
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+ /**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class PanelMenuGroupRendererTest extends RendererTestBase {
+
+ @Test
+ public void testEmpty() throws IOException, SAXException {
+ doTest("panelMenuGroup", "f:panelMenuGroup");
+ }
+
+ @Test
+ public void testExpanded() throws IOException, SAXException {
+ doTest("panelMenuGroup-expanded", "f:panelMenuGroup");
+ }
+
+}
+
+
+
Added:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuItemRendererTest.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuItemRendererTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuItemRendererTest.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.renderkit.html;
+
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+ /**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class PanelMenuItemRendererTest extends RendererTestBase {
+
+ @Test
+ public void testDoEncode() throws IOException, SAXException {
+ doTest("panelMenuItem", "f:panelMenuItem");
+ }
+
+}
+
+
+
Modified:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java 2010-10-31
17:38:22 UTC (rev 19805)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -23,7 +23,6 @@
package org.richfaces.renderkit.html;
-import org.junit.Ignore;
import org.junit.Test;
import org.xml.sax.SAXException;
@@ -36,9 +35,8 @@
public class PanelMenuRendererTest extends RendererTestBase {
@Test
- @Ignore
public void testDoEncode() throws IOException, SAXException {
- doTest("panelMenu", "panelMenu");
+ doTest("panelMenu", "f:panelMenu");
}
}
Modified:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-10-31
17:38:22 UTC (rev 19805)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-10-31
20:24:22 UTC (rev 19806)
@@ -60,6 +60,8 @@
environment = new HtmlUnitEnvironment();
environment.withWebRoot(new
File(this.getClass().getResource(".").toURI()));
environment.start();
+
+ environment.getWebClient().setJavaScriptEnabled(false);
}
@After
@@ -82,7 +84,7 @@
return;
}
- Diff xmlDiff = new Diff(new StringReader(pageCode), new
InputStreamReader(expectedPageCode));
+ Diff xmlDiff = new Diff(new InputStreamReader(expectedPageCode), new
StringReader(pageCode));
xmlDiff.overrideDifferenceListener(new IgnoreScriptsContent());
Assert.assertTrue("XML was not similar:" + xmlDiff.toString() +
"\n\n" + pageCode, xmlDiff.similar());
}
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml 2010-10-31
17:38:22 UTC (rev 19805)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -37,9 +37,7 @@
<h:body>
<h:form id="f" style="border:blue solid thin;">
- <pn:panelMenu id="panelMenu">
- <!-- TODO -->
- </pn:panelMenu>
+ <pn:panelMenu id="panelMenu"></pn:panelMenu>
</h:form>
</h:body>
</html>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml 2010-10-31
17:38:22 UTC (rev 19805)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -1,5 +1,7 @@
-<div id="panelMenu" class="rf-panelMenu">
- <script type="text/javascript">
- // Text between <script> ... </script> don't compared
- </script>
+<div id="f:panelMenu" class="rf-pm">
+ <input id="f:panelMenu-value" name="f:panelMenu-value"
type="hidden"/>
+ <script type="text/javascript">
+ // Text
+ </script>
+
</div>
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xhtml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xhtml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces PanelMenuGroup Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:panelMenuGroup id="panelMenuGroup" expanded="true"
label="Group Label">
+ <!-- TODO -->
+ </pn:panelMenuGroup>
+ </h:form>
+</h:body>
+</html>
+
+
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,12 @@
+<div id="f:panelMenuGroup" class="rf-pm-gr">
+ <input id="f:panelMenuGroup:expanded"
name="f:panelMenuGroup:expanded" type="hidden"
value="true"/>
+ <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr">
+ Group Label
+ </div>
+ <div id="f:panelMenuGroup:cnt" class="rf-pm-gr-cnt
rf-pm-exp">
+
+ </div>
+ <script type="text/javascript">
+ // Text
+ </script>
+</div>
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xhtml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xhtml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces PanelMenuGroup Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:panelMenuGroup id="panelMenuGroup">
+ <!-- TODO -->
+ </pn:panelMenuGroup>
+ </h:form>
+</h:body>
+</html>
+
+
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,12 @@
+<div id="f:panelMenuGroup" class="rf-pm-gr">
+ <input id="f:panelMenuGroup:expanded"
name="f:panelMenuGroup:expanded" type="hidden"
value="false"/>
+ <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr">
+ panelMenuGroup
+ </div>
+ <div id="f:panelMenuGroup:cnt" class="rf-pm-gr-cnt
rf-pm-colps">
+
+ </div>
+ <script type="text/javascript">
+ // Text
+ </script>
+</div>
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xhtml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xhtml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces PanelMenuItem Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:panelMenuItem id="panelMenuItem">
+ <!-- TODO -->
+ </pn:panelMenuItem>
+ </h:form>
+</h:body>
+</html>
+
+
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml 2010-10-31
20:24:22 UTC (rev 19806)
@@ -0,0 +1,7 @@
+<div id="f:panelMenuItem" class="rf-pm-itm">
+ panelMenuItem
+
+ <script type="text/javascript">
+ // Text
+ </script>
+</div>