JBoss Rich Faces SVN: r917 - trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-29 06:32:05 -0400 (Tue, 29 May 2007)
New Revision: 917
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-05-29 10:23:24 UTC (rev 916)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-05-29 10:32:05 UTC (rev 917)
@@ -219,7 +219,7 @@
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name> dataModel</property-name>
- <property-class>org.richfaces.model.ScrollableGridDataModel2</property-class>
+ <property-class>org.richfaces.model.ScrollableGridDataModel</property-class>
<value>#{dataModel}</value>
</managed-property>
<managed-property>
17 years, 7 months
JBoss Rich Faces SVN: r916 - trunk/richfaces/menu-components/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-05-29 06:23:24 -0400 (Tue, 29 May 2007)
New Revision: 916
Modified:
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
Log:
iconFolder facet fixed
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2007-05-29 10:21:49 UTC (rev 915)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2007-05-29 10:23:24 UTC (rev 916)
@@ -57,7 +57,7 @@
<![CDATA[if(component.getFacet("iconFolder")!=null && component.getFacet("iconFolder").isRendered()) {]]>
</jsp:scriptlet>
<div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder">
- <u:insertFacet name="iconFolderDisabled" />
+ <u:insertFacet name="iconFolder" />
</div>
<jsp:scriptlet>
<![CDATA[} else if (component.getAttributes().get("iconFolder")!=null) {]]>
17 years, 7 months
JBoss Rich Faces SVN: r915 - in trunk/richfaces/suggestionbox/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-05-29 06:21:49 -0400 (Tue, 29 May 2007)
New Revision: 915
Modified:
trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
Exadel replaced with RichFaces
Modified: trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-05-28 20:02:22 UTC (rev 914)
+++ trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-05-29 10:21:49 UTC (rev 915)
@@ -300,7 +300,7 @@
StringBuffer script = new StringBuffer(" new ");
// Build ajax function call
JSFunction submitSuggest = AjaxRendererUtils.buildAjaxFunction(
- component, context, "Exadel.Suggestion");
+ component, context, "RichFaces.Suggestion");
UIComponent targetComponent = getTarget(component);
submitSuggest.addParameter(targetComponent.getClientId(context));
submitSuggest.addParameter(component.getClientId(context));
Modified: trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-05-28 20:02:22 UTC (rev 914)
+++ trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-05-29 10:21:49 UTC (rev 915)
@@ -1,4 +1,4 @@
-if (!Exadel) var Exadel = {};
+if (!RichFaces) var RichFaces = {};
var Suggestion = {};
Suggestion.Base = function() {
};
@@ -39,7 +39,7 @@
|| update.style.position
== 'absolute') {
update.style.position = 'absolute';
- Exadel.Position.smartClone(element, update, options);
+ RichFaces.Position.smartClone(element, update, options);
}
if (!window.opera) {
Effect.Appear(update, {duration:0.15});
@@ -297,7 +297,7 @@
onClick: function(event) {
this.wasScroll = false;
- this.wasBlur = false;
+ this.wasBlur = false;
var element = Event.findElement(event, 'TR');
this.index = element.autocompleteIndex;
this.selectEntry(event);
@@ -307,7 +307,7 @@
onBlur: function(event) {
if (this.isUnloaded()) return;
if (!this.active) return;
- var offsets = Exadel.Position.calcOffsets(this.update);
+ var offsets = RichFaces.Position.calcOffsets(this.update);
if (RichFaces.navigatorType() != "MSIE") {
offsets["x"] = 0;
offsets["y"] = 0;
@@ -322,7 +322,7 @@
}
// needed to make click events working
setTimeout(this.hide.bind(this), 250);
- this.wasBlur = true;
+ this.wasBlur = true;
},
onScroll: function(event) {
@@ -330,7 +330,7 @@
if(this.element) {
this.element.focus();
this.wasScroll = true;
- this.wasBlur = false;
+ this.wasBlur = false;
}
}
},
@@ -533,8 +533,8 @@
}
-Exadel.Suggestion = Class.create();
-Object.extend(Object.extend(Exadel.Suggestion.prototype, Suggestion.Base.prototype), {
+RichFaces.Suggestion = Class.create();
+Object.extend(Object.extend(RichFaces.Suggestion.prototype, Suggestion.Base.prototype), {
initialize: function(containerId, actionUrl, element, content, onsubmit, options) {
var update = options.popup || 'ac1update';
if (!$(update)) this.create(element, update, content, options);
@@ -572,7 +572,7 @@
if (!this.update.style.position || this.update.style.position
== 'absolute') {
this.update.style.position = 'absolute';
- Exadel.Position.smartClone(this.element, this.update, this.options);
+ RichFaces.Position.smartClone(this.element, this.update, this.options);
}
this.updateChoices();
LOG.debug("Choices updated");
@@ -599,7 +599,7 @@
});
-Exadel.Position = {
+RichFaces.Position = {
source: null,
target: null,
smartClone: function(source, target, options) {
@@ -614,7 +614,7 @@
/*
http://jira.exadel.com/browse/RFA-236
- var pos = Exadel.SmartPosition.getPosition(this.source, this.target, options);
+ var pos = RichFaces.SmartPosition.getPosition(this.source, this.target, options);
if (RichFaces.navigatorType() == "MSIE") {
var offsets = this.calcOffsets(this.source);
17 years, 7 months
JBoss Rich Faces SVN: r914 - trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-05-28 16:02:22 -0400 (Mon, 28 May 2007)
New Revision: 914
Modified:
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
JS error on empty tree fixed
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-05-28 19:26:47 UTC (rev 913)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-05-28 20:02:22 UTC (rev 914)
@@ -107,10 +107,12 @@
this.elements.contentTd = $(contentId);
- for (var i = 0; i < this.elements.contentTd.childNodes.length; i++) {
- var child = this.elements.contentTd.childNodes[i];
- if (child.nodeType == 1 && child.tagName.toLowerCase() == "table") {
- this.addChild(new Tree.Item(child.id, this, this, this.childs.length, this.switchType));
+ if (this.elements.contentTd) {
+ for (var i = 0; i < this.elements.contentTd.childNodes.length; i++) {
+ var child = this.elements.contentTd.childNodes[i];
+ if (child.nodeType == 1 && child.tagName.toLowerCase() == "table") {
+ this.addChild(new Tree.Item(child.id, this, this, this.childs.length, this.switchType));
+ }
}
}
},
17 years, 7 months
JBoss Rich Faces SVN: r913 - trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-05-28 15:26:47 -0400 (Mon, 28 May 2007)
New Revision: 913
Modified:
trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-242 in progress
Modified: trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp 2007-05-28 19:26:41 UTC (rev 912)
+++ trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp 2007-05-28 19:26:47 UTC (rev 913)
@@ -22,11 +22,38 @@
<mc:menuItem id="menuItem12" value="Active12" actionListener="#{bean.actionListener}" immediate="true"/>
<mc:menuItem id="menuItem13" value="Active13" action="#{bean.action}" icon="/images/ico1.gif"/>
<mc:menuItem id="menuItem14" value="Active14"/>
- <mc:menuGroup id="menuGroup1" value="Group1" direction="#{bean.groupDirection}">
+ <mc:menuGroup id="menuGroup1" value="Group1" direction="#{bean.groupDirection}" icon="/images/ico1.gif">
<mc:menuItem id="menuGroup1Item1" value="Active"/>
<mc:menuItem id="menuGroup1Item2" value="Active" icon="/images/ico1.gif"/>
<mc:menuItem id="menuGroup1Item3" value="Active"/>
</mc:menuGroup>
+ <mc:menuGroup id="menuGroup1Dsbld" value="Group1 dsbld." direction="#{bean.groupDirection}" icon="/images/ico1.gif" iconDisabled="/images/ico2.gif" disabled="true" />
+
+
+ <mc:menuGroup id="menuGroup11" value="Group11" direction="#{bean.groupDirection}" iconFolder="/images/ico1.gif">
+ <mc:menuItem id="menuGroup11Item1" value="Active"/>
+ <mc:menuItem id="menuGroup11Item2" value="Active" icon="/images/ico1.gif"/>
+ <mc:menuItem id="menuGroup11Item3" value="Active"/>
+ </mc:menuGroup>
+ <mc:menuGroup id="menuGroup11Dsbld" value="Group11 dsbld." direction="#{bean.groupDirection}" iconFolder="/images/ico1.gif" iconFolderDisabled="/images/ico2.gif" disabled="true" />
+
+ <mc:menuGroup id="menuGroup12" value="Group12" direction="#{bean.groupDirection}">
+ <f:facet name="iconFolder">
+ <h:graphicImage value="/images/ico1.gif" />
+ </f:facet>
+ <mc:menuItem id="menuGroup12Item1" value="Active"/>
+ <mc:menuItem id="menuGroup12Item2" value="Active" icon="/images/ico1.gif"/>
+ <mc:menuItem id="menuGroup12Item3" value="Active"/>
+ </mc:menuGroup>
+ <mc:menuGroup id="menuGroup12Dsbld" value="Group12 dsbld." direction="#{bean.groupDirection}" disabled="true">
+ <f:facet name="iconFolderDisabled">
+ <h:graphicImage value="/images/ico2.gif" />
+ </f:facet>
+ </mc:menuGroup>
+
+
+
+
<mc:menuItem id="menuItem15" value="Active15" icon="/images/ico2.gif"/>
<mc:menuSeparator id="menuSeparator11"/>
17 years, 7 months
JBoss Rich Faces SVN: r912 - in trunk/richfaces/menu-components/src: main/java/org/richfaces/renderkit/html and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-05-28 15:26:41 -0400 (Mon, 28 May 2007)
New Revision: 912
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuGroupComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-242 in progress
Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java 2007-05-28 19:24:36 UTC (rev 911)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java 2007-05-28 19:26:41 UTC (rev 912)
@@ -33,4 +33,16 @@
public abstract boolean isDisabled();
public abstract void setDisabled(boolean disabled);
+
+ public abstract String getIcon();
+ public abstract void setIcon(String icon);
+
+ public abstract String getIconDisabled();
+ public abstract void setIconDisabled(String icon);
+
+ public abstract String getIconFolder();
+ public abstract void setIconFolder(String icon);
+
+ public abstract String getIconFolderDisabled();
+ public abstract void setIconFolderDisabled(String icon);
}
Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2007-05-28 19:24:36 UTC (rev 911)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2007-05-28 19:26:41 UTC (rev 912)
@@ -21,13 +21,24 @@
package org.richfaces.renderkit.html;
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
+import org.ajax4jsf.framework.renderer.ComponentVariables;
+import org.ajax4jsf.framework.renderer.ComponentsVariableResolver;
import org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase;
+import org.ajax4jsf.framework.util.command.CommandScriptBuilder;
+import org.richfaces.component.MenuComponent;
import org.richfaces.component.UIMenuGroup;
+import org.richfaces.component.UIMenuItem;
+import org.richfaces.component.util.ViewUtil;
public class MenuGroupRendererBase extends HeaderResourcesRendererBase {
-
+
protected Class getComponentClass() {
return UIMenuGroup.class;
}
@@ -35,5 +46,43 @@
public boolean getRendersChildren() {
return true;
}
+
+ private String getSpacerUri(FacesContext context, UIMenuGroup menuGroup) {
+ return getResource("images/spacer.gif").getUri(
+ context, menuGroup);
+ }
+ public void initializeResources(FacesContext context, UIMenuGroup menuGroup)
+ throws IOException {
+ ComponentVariables variables =
+ ComponentsVariableResolver.getVariables(this, menuGroup);
+
+ String icon = ViewUtil.getResourceURL(menuGroup.getIcon());
+ if (icon == null) {
+ icon = getSpacerUri(context, menuGroup);
+ }
+
+ variables.setVariable("icon", icon);
+
+ String iconDisabled = ViewUtil.getResourceURL(menuGroup.getIconDisabled());
+ if (iconDisabled == null) {
+ iconDisabled = getSpacerUri(context, menuGroup);
+ }
+
+ variables.setVariable("iconDisabled", iconDisabled);
+
+ String iconFolder = ViewUtil.getResourceURL(menuGroup.getIconFolder());
+ if (iconFolder == null) {
+ iconFolder = getSpacerUri(context, menuGroup);
+ }
+
+ variables.setVariable("iconFolder", iconFolder);
+
+ String iconFolderDisabled = ViewUtil.getResourceURL(menuGroup.getIconFolderDisabled());
+ if (iconFolderDisabled == null) {
+ iconFolderDisabled = getSpacerUri(context, menuGroup);
+ }
+
+ variables.setVariable("iconFolderDisabled", iconFolderDisabled);
+ }
}
Modified: trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
===================================================================
--- trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-05-28 19:24:36 UTC (rev 911)
+++ trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-05-28 19:26:41 UTC (rev 912)
@@ -37,16 +37,21 @@
.dr-menu-item a {
text-decoration : none;
}
+
.dr-menu-node {
position : absolute;
- background : url(node.gif) no-repeat top;
width : 7px;
height : 7px;
+ font-size : 1px;
+ right : 0px;
+}
+
+.dr-menu-node-icon {
top : 7px;
right : 6px;
- font-size : 1px;
}
-.dr-menu-item-disabled .dr-menu-node {
+
+.dr-menu-item-disabled .dr-menu-node-icon {
background-position : bottom;
}
]]>
@@ -74,7 +79,7 @@
<u:style name="background-color" skin="tipBackgroundColor" />
</u:selector>
-<u:selector name=".dr-menu-node">
+<u:selector name=".dr-menu-node-icon">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.images.MenuNodeImage"/>
</u:style>
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2007-05-28 19:24:36 UTC (rev 911)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2007-05-28 19:26:41 UTC (rev 912)
@@ -18,6 +18,7 @@
</h:scripts>
<f:clientid var="clientId"/>
+ <f:call name="initializeResources" />
<f:resource name="/org/richfaces/renderkit/html/images/spacer.gif" var="spacer" />
<jsp:scriptlet><![CDATA[
@@ -40,7 +41,7 @@
</jsp:scriptlet>
<img width="16" height="16"
style="#{component.attributes['iconStyle']}"
- src="#{component.attributes['icon']}"/>
+ src="#{icon}"/>
<jsp:scriptlet>
<![CDATA[} else {]]>
</jsp:scriptlet>
@@ -51,8 +52,28 @@
</span>
<span id="ref#{clientId}:anchor" class="rich-menu-item-label">#{component.attributes['value']}</span>
- <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder"/>
-
+
+ <jsp:scriptlet>
+ <![CDATA[if(component.getFacet("iconFolder")!=null && component.getFacet("iconFolder").isRendered()) {]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder">
+ <u:insertFacet name="iconFolderDisabled" />
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[} else if (component.getAttributes().get("iconFolder")!=null) {]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder #{component.attributes['iconClass']}">
+ <img width="16" height="16"
+ style="#{component.attributes['iconStyle']}"
+ src="#{iconFolder}"/>
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node dr-menu-node-icon rich-menu-item-folder"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
</div>
<jsp:scriptlet><![CDATA[} else {]]></jsp:scriptlet>
@@ -71,7 +92,7 @@
</jsp:scriptlet>
<img width="16" height="16"
style="#{component.attributes['iconStyle']}"
- src="#{component.attributes['iconDisabled']}"/>
+ src="#{iconDisabled}"/>
<jsp:scriptlet>
<![CDATA[} else {]]>
</jsp:scriptlet>
@@ -82,7 +103,28 @@
</span>
<span class="rich-menu-item-label-disabled">#{component.attributes['value']}</span>
- <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder-disabled"/>
+
+ <jsp:scriptlet>
+ <![CDATA[if(component.getFacet("iconFolderDisabled")!=null && component.getFacet("iconFolderDisabled").isRendered()) {]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder-disabled">
+ <u:insertFacet name="iconFolderDisabled" />
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[} else if (component.getAttributes().get("iconFolderDisabled")!=null) {]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder-disabled #{component.attributes['iconClass']}">
+ <img width="16" height="16"
+ style="#{component.attributes['iconStyle']}"
+ src="#{iconFolderDisabled}"/>
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node dr-menu-node-icon rich-menu-item-folder-disabled"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
</div>
<jsp:scriptlet><![CDATA[}]]></jsp:scriptlet>
Modified: trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuGroupComponentTest.java
===================================================================
--- trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuGroupComponentTest.java 2007-05-28 19:24:36 UTC (rev 911)
+++ trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuGroupComponentTest.java 2007-05-28 19:26:41 UTC (rev 912)
@@ -232,7 +232,7 @@
assertNotNull(div);
assertEquals("div", div.getNodeName());
classAttr = div.getAttributeValue("class");
- assertTrue(classAttr.contains("dr-menu-node rich-menu-item-folder"));
+ assertTrue(classAttr.contains("dr-menu-node dr-menu-node-icon rich-menu-item-folder"));
}
17 years, 7 months
JBoss Rich Faces SVN: r911 - trunk/richfaces/drag-drop.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-05-28 15:24:36 -0400 (Mon, 28 May 2007)
New Revision: 911
Modified:
trunk/richfaces/drag-drop/
Log:
.clover svn:ignored
Property changes on: trunk/richfaces/drag-drop
___________________________________________________________________
Name: svn:ignore
- target
.settings
.classpath
.project
+ target
.settings
.classpath
.project
.clover
17 years, 7 months
JBoss Rich Faces SVN: r910 - in trunk/richfaces/panelmenu/src/main: java/org/richfaces/component/panelmenu and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-05-28 14:48:31 -0400 (Mon, 28 May 2007)
New Revision: 910
Modified:
trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml
trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java
trunk/richfaces/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
Log:
Modified: trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml
===================================================================
--- trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml 2007-05-28 18:13:40 UTC (rev 909)
+++ trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml 2007-05-28 18:48:31 UTC (rev 910)
@@ -415,7 +415,13 @@
<classname>java.lang.String</classname>
<description>CSS style rules to be applied</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
+ </property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>Displayed node's text</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
</component>
<component>
Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java 2007-05-28 18:13:40 UTC (rev 909)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java 2007-05-28 18:48:31 UTC (rev 910)
@@ -22,14 +22,14 @@
package org.richfaces.component.panelmenu;
import javax.faces.component.ActionSource;
-import javax.faces.component.UICommand;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import javax.faces.event.FacesEvent;
-import org.richfaces.component.UISwitchablePanel;
-
public abstract class UIPanelMenuGroup extends UIInput implements ActionSource{
public static final String COMPONENT_TYPE = "org.richfaces.panelMenuGroup";
@@ -76,6 +76,8 @@
public abstract void setOncollapse(String ongroupcollapse);
public abstract String getOnexpand();
public abstract void setOnexpand(String ongroupexpand);
+ public abstract String getLabel();
+ public abstract void setLabel(String label);
public void addActionListener(ActionListener listener) {
@@ -132,6 +134,23 @@
values[2] = saveAttachedState(context, actionListener);
return values;
}
-
-
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ // TODO Auto-generated method stub
+ super.broadcast(event);
+ if(event instanceof ActionEvent){
+ FacesContext context = getFacesContext();
+ // Notify the specified action listener method (if any)
+ MethodBinding mb = getActionListener();
+ if (mb != null) {
+ mb.invoke(context, new Object[] { event });
+ }
+
+ // Invoke the default ActionListener
+ ActionListener listener =
+ context.getApplication().getActionListener();
+ if (listener != null) {
+ listener.processAction((ActionEvent) event);
+ }
+ }
+ }
}
Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java 2007-05-28 18:13:40 UTC (rev 909)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java 2007-05-28 18:48:31 UTC (rev 910)
@@ -179,4 +179,12 @@
return "";
}
+
+ public void insertLabel(FacesContext context, UIComponent component) throws IOException {
+ Object label = component.getAttributes().get("label");
+ if (label!=null){
+ context.getResponseWriter().write(label.toString());
+ }
+ }
+
}
Modified: trunk/richfaces/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
===================================================================
--- trunk/richfaces/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2007-05-28 18:13:40 UTC (rev 909)
+++ trunk/richfaces/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2007-05-28 18:48:31 UTC (rev 910)
@@ -48,7 +48,7 @@
<input type="hidden" name="panelMenuAction#{clientId}"
value="" >
</input>
- <f:call name="insertValue"/>
+ <f:call name="insertLabel"/>
</td>
<td>
17 years, 7 months
JBoss Rich Faces SVN: r909 - trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:13:40 -0400 (Mon, 28 May 2007)
New Revision: 909
Added:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel.java
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/SelectionBean.java
Log:
Added: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel.java (rev 0)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel.java 2007-05-28 18:13:40 UTC (rev 909)
@@ -0,0 +1,171 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/bean/ChannelDataModel.java,v $
+ * $Revision: 1.4 $
+ */
+
+package org.richfaces.demo.datagrid.bean;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.richfaces.demo.datagrid.model.Channel;
+import org.richfaces.demo.datagrid.model.Issue;
+import org.richfaces.model.DataRange;
+import org.richfaces.model.ScrollableGridDataModel2;
+import org.richfaces.model.SortOrder;
+import org.richfaces.model.snapshot.ObjectLocator;
+
+/**
+ * Example data model. Uses {@link Channel} instance as data storage
+ *
+ * @author Maksim Kaszynski
+ *
+ */
+public class ChannelDataModel extends ScrollableGridDataModel2 {
+
+ /**
+ * Data range implementation. Wraps query result
+ * @author Maksim Kaszynski
+ *
+ */
+ public static class ChannelDataRange extends DataRange {
+
+ private List <Issue> window;
+
+ public ChannelDataRange(int startRow, int endRow, SortOrder sortOrder, List <Issue> window) {
+ super(startRow, endRow, sortOrder);
+ this.window = window;
+ }
+
+ /**
+ * get loaded object
+ * @see com.exadel.jsf.model.DataRange#getRowData(int)
+ */
+ @Override
+ public Object getRowData(int index) {
+ return window.get(index - getStartRow());
+ }
+ }
+
+ /**
+ * Minimize LIST queries. Locate objects by their IDs
+ * @author Maksim Kaszynski
+ *
+ */
+ public class IssueLocator implements ObjectLocator {
+
+ public Collection findObjects(Collection ids) {
+ System.out.println("IssueLocator.findObjects()" + ids);
+
+ //sort of find by ids
+ List <Issue> issues = new ArrayList<Issue>(ids.size());
+ for (Object key : ids) {
+ Integer id = (Integer) key;
+ Issue issue = getChannel().findById(id);
+ issues.add(issue);
+ }
+
+ return issues;
+ }
+
+ public Serializable getObjectId(Object object) {
+ Issue issue = (Issue) object;
+ Integer id = issue.getIndex();
+ return id;
+ }
+
+ }
+
+ private ObjectLocator objectLocator = new IssueLocator();
+ private Channel channel;
+ private int rowIndex;
+
+ /**
+ * Load part of channel.
+ */
+ @Override
+ protected DataRange createDataRange(int startRow, int endRow,
+ SortOrder sortOrder) {
+ //access storage to get data
+ List <Issue> window = getChannel().executeQuery(startRow, endRow, sortOrder);
+ System.out.println("ChannelDataModel.createDataRange()");
+ return new ChannelDataRange(startRow, endRow, sortOrder, window);
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#getRowCount()
+ */
+ @Override
+ public int getRowCount() {
+ return getChannel().size();
+ }
+
+
+ @Override
+ public Object getWrappedData() {
+ return getChannel();
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#isRowAvailable()
+ */
+ @Override
+ public boolean isRowAvailable() {
+ return rowIndex < getRowCount();
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ setChannel((Channel) data);
+ }
+
+ /**
+ * @return the channel
+ */
+ public Channel getChannel() {
+ return channel;
+ }
+
+ /**
+ * @param channel the channel to set
+ */
+ public void setChannel(Channel channel) {
+ this.channel = channel;
+ }
+
+ /**
+ * @return the rowIndex
+ */
+ public int getRowIndex() {
+ return rowIndex;
+ }
+
+ /**
+ * @param rowIndex the rowIndex to set
+ */
+ public void setRowIndex(int rowIndex) {
+ this.rowIndex = rowIndex;
+ }
+
+ /**
+ * @return the objectLocator
+ */
+ public ObjectLocator getObjectLocator() {
+ return objectLocator;
+ }
+
+ /**
+ * @param objectLocator the objectLocator to set
+ */
+ public void setObjectLocator(ObjectLocator objectLocator) {
+ this.objectLocator = objectLocator;
+ }
+
+}
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/SelectionBean.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/SelectionBean.java 2007-05-28 18:13:31 UTC (rev 908)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/SelectionBean.java 2007-05-28 18:13:40 UTC (rev 909)
@@ -1,31 +1,89 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/bean/SelectionBean.java,v $
+ * $Revision: 1.19 $
+ */
+
package org.richfaces.demo.datagrid.bean;
+import javax.faces.event.ActionEvent;
-import java.util.List;
-
import org.richfaces.demo.datagrid.model.Channel;
+import org.richfaces.demo.datagrid.model.Issue;
+import org.richfaces.model.ScrollableGridDataModel2;
+import org.richfaces.model.visual.ScrollableGridVisualModel;
-
-public class SelectionBean{
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SelectionBean {
- List dataModel;
+ private ScrollableGridVisualModel visualModel;
- Channel channel;
+ private ScrollableGridDataModel2 dataModel;
+ private Channel channel;
- public SelectionBean(){
- System.out.println("create SelectionBean");
- }
+ private String key;
- public List getDataModel() {
+ private int id;
+
+
+ public ScrollableGridDataModel2 getDataModel() {
return dataModel;
}
- public void setDataModel(List dataModel) {
+ public void setDataModel(ScrollableGridDataModel2 dataModel) {
this.dataModel = dataModel;
}
+ public ScrollableGridVisualModel getVisualModel() {
+ return visualModel;
+ }
+
+ /**
+ * @param visualModel the visualModel to set
+ */
+ public void setVisualModel(ScrollableGridVisualModel visualModel) {
+ this.visualModel = visualModel;
+ }
+
+ public SelectionBean() {
+
+ }
+
+ public void setKeyz(ActionEvent e) {
+ System.out.println("SelectionBean.setKeyz() " + key + "id " + id);
+ Channel channel = (Channel) getDataModel().getWrappedData ();
+ Issue issue = channel.getIndex().get(id);
+ if (issue != null) {
+ channel.getIndex().remove(issue.getIndex());
+ channel.getIssues().remove(issue);
+ }
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
public Channel getChannel() {
return channel;
}
@@ -33,5 +91,5 @@
public void setChannel(Channel channel) {
this.channel = channel;
}
+}
-}
17 years, 7 months
JBoss Rich Faces SVN: r908 - trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:13:31 -0400 (Mon, 28 May 2007)
New Revision: 908
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
Log:
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2007-05-28 18:13:23 UTC (rev 907)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2007-05-28 18:13:31 UTC (rev 908)
@@ -17,9 +17,13 @@
import java.util.List;
import java.util.Map;
+import org.richfaces.model.SortOrder;
+
+
/**
* @author Maksim Kaszynski
+ * @modified by Anton Belevich
*
*/
public class Channel {
@@ -86,7 +90,43 @@
};
};
+ static final Comparator<Issue> byKeyAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getKey().compareTo(o2.getKey());
+ };
+ };
+ static final Comparator<Issue> byKeyDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -byKeyAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> byResolutionDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -byResolutionAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> byResolutionAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getResolution().compareTo(o2.getResolution());
+ };
+ };
+
+ static final Comparator<Issue> bySummaryDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -bySummaryAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> bySummaryAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getSummary().compareTo(o2.getSummary());
+ };
+ };
+
+
private List<Issue> issues = new ArrayList<Issue>();
private String title;
private String description;
@@ -109,22 +149,22 @@
* @param sortOrder
* @return
*/
-// public List <Issue> executeQuery(int startRow, int endRow, SortOrder sortOrder) {
-// System.out.println("Channel.executeQuery()");
-// List <Issue> copy = getIssues();
-// if (sortOrder != null) {
-// copy = new ArrayList<Issue>(getIssues());
-// Comparator<Issue> comparator = createComparator(sortOrder);
-// if (comparator != null) {
-// Collections.sort(copy, comparator);
-// }
-// }
-// List <Issue> issuz = new ArrayList<Issue>(endRow - startRow + 1);
-// for(int i = startRow; i < endRow; i++ ) {
-// issuz.add(copy.get(i));
-// }
-// return issuz;
-// }
+ public List <Issue> executeQuery(int startRow, int endRow, SortOrder sortOrder) {
+ System.out.println("Channel.executeQuery()");
+ List <Issue> copy = getIssues();
+ if (sortOrder != null) {
+ copy = new ArrayList<Issue>(getIssues());
+ Comparator<Issue> comparator = createComparator(sortOrder);
+ if (comparator != null) {
+ Collections.sort(copy, comparator);
+ }
+ }
+ List <Issue> issuz = new ArrayList<Issue>(endRow - startRow + 1);
+ for(int i = startRow; i < endRow; i++ ) {
+ issuz.add(copy.get(i));
+ }
+ return issuz;
+ }
/**
@@ -205,27 +245,33 @@
this.index = index;
}
-// protected Comparator <Issue> createComparator(SortOrder sortOrder) {
-// String prop = sortOrder.getSortField();
-// boolean asc = sortOrder.isAscending();
-//
-// if ("priority".equals(prop)) {
-// return asc ? byPriAsc : byPriDesc;
-// } else if ("assignee".equals(prop)) {
-// return asc ? byAssigneeAsc : byAssigneeDesc;
-// } else if ("reporter".equals(prop)) {
-// return asc ? byReporterAsc : byReporterDesc;
-// } else if ("id".equals(prop)) {
-// return asc ? byIdAsc : byIdDesc;
-//
-// } else if ("status".equals(prop)) {
-// return asc ? byStatusAsc : byStatusDesc;
-//
-// }
-//
-// return null;
-// }
-//
+
+ protected Comparator <Issue> createComparator(SortOrder sortOrder) {
+ int prop = sortOrder.getSortColumn();
+ boolean asc = sortOrder.isAscending();
+
+ switch (prop) {
+ case 0:
+ return asc ? byIdAsc : byIdDesc;
+ case 1:
+ return asc ? byKeyAsc : byKeyDesc;
+ case 2:
+ return asc ? bySummaryAsc : bySummaryDesc;
+ case 3:
+ return asc ? byAssigneeAsc : byAssigneeDesc;
+ case 4:
+ return asc ? byStatusAsc : byStatusDesc;
+ case 5:
+ return asc ? byReporterAsc : byReporterDesc;
+ case 6:
+ return asc ? byPriAsc: byPriDesc;
+ case 7:
+ return asc ? byResolutionAsc : byResolutionDesc;
+ }
+
+ return null;
+ }
+
public Issue findById(Integer id) {
return getIndex().get(id);
}
17 years, 7 months