JBoss Rich Faces SVN: r248 - trunk/richfaces/menu-components/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-04-03 10:08:52 -0400 (Tue, 03 Apr 2007)
New Revision: 248
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java
Log:
setter and getter for disabled attribute added
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-04-03 14:01:05 UTC (rev 247)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java 2007-04-03 14:08:52 UTC (rev 248)
@@ -30,4 +30,7 @@
*/
public abstract class UIMenuGroup extends UIOutput {
+ public abstract boolean isDisabled();
+ public abstract void setDisabled(boolean disabled);
+
}
17 years, 9 months
JBoss Rich Faces SVN: r247 - trunk/richfaces/menu-components/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-04-03 10:01:05 -0400 (Tue, 03 Apr 2007)
New Revision: 247
Modified:
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
Log:
style changed for disabled state
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2007-04-03 13:58:23 UTC (rev 246)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2007-04-03 14:01:05 UTC (rev 247)
@@ -87,7 +87,7 @@
<jsp:scriptlet><![CDATA[}]]></jsp:scriptlet>
</span>
- <span class="rich-menu-item-label-disabled">#{component.attributes['value']}</span>
+ <span class="dr-menu-label dr-menu-label-disabled rich-menu-item-label-disabled">#{component.attributes['value']}</span>
<div class="dr-menu-node rich-menu-item-folder-disabled"/>
</div>
17 years, 9 months
JBoss Rich Faces SVN: r246 - in trunk/richfaces/menu-components/src/test: resources and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-04-03 09:58:23 -0400 (Tue, 03 Apr 2007)
New Revision: 246
Added:
trunk/richfaces/menu-components/src/test/resources/
trunk/richfaces/menu-components/src/test/resources/WEB-INF/
trunk/richfaces/menu-components/src/test/resources/WEB-INF/web.xml
Log:
Has added resources for test application.
Added: trunk/richfaces/menu-components/src/test/resources/WEB-INF/web.xml
===================================================================
--- trunk/richfaces/menu-components/src/test/resources/WEB-INF/web.xml (rev 0)
+++ trunk/richfaces/menu-components/src/test/resources/WEB-INF/web.xml 2007-04-03 13:58:23 UTC (rev 246)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>testcase</display-name>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+
+ <filter>
+ <description>Convert HTML to XML</description>
+ <display-name>Filter</display-name>
+ <filter-name>A4J</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>publicid</param-name>
+ <param-value>-//W3C//DTD XHTML 1.0 Transitional//EN</param-value>
+ </init-param>
+ <init-param>
+ <param-name>systemid</param-name>
+ <param-value>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</param-value>
+ </init-param>
+ <init-param>
+ <param-name>namespace</param-name>
+ <param-value>http://www.w3.org/1999/xhtml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>forceparser</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>rewriteid</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>mime-type</param-name>
+ <param-value>text/xml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>log4j-init-file</param-name>
+ <param-value>WEB-INF/log4j.xml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>enable-cache</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>A4J</filter-name>
+ <url-pattern>*.jsf</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>A4J</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+</web-app>
17 years, 9 months
JBoss Rich Faces SVN: r245 - trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-04-03 09:49:20 -0400 (Tue, 03 Apr 2007)
New Revision: 245
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
Log:
MenuItem component development.
Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-04-03 13:48:54 UTC (rev 244)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-04-03 13:49:20 UTC (rev 245)
@@ -103,20 +103,19 @@
+ getStringAttributeOrEmptyString(menuItem, "iconClass");
variables.setVariable("iconClass", resource);
- resource = "dr-menu-label dr-menu-label-disabled rich-menu-item-label rich-menu-item-label-disabled";
- // + (String) menuItem.getAttributes().get("iconClass");
+ resource = "dr-menu-label dr-menu-label-disabled rich-menu-item-label rich-menu-item-label-disabled";
variables.setVariable("labelClass", resource);
+ variables.setVariable("onclick", "Event.stop(event || window.event);");
+
} else {
StringBuffer scriptValue = new StringBuffer();
scriptValue.append("this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled ")
.append(getStringAttributeOrEmptyString(menuItem, "styleClass") + "'; ");
- processInlineStyles(context, menuItem, scriptValue, false);
- //if (null == getIconFacet(menuItem)) {
- scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":icon').className='dr-menu-icon rich-menu-item-icon ")
- .append(getStringAttributeOrEmptyString(menuItem, "iconClass") + "'; ");
- //}
+ processInlineStyles(context, menuItem, scriptValue, false);
+ scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":icon').className='dr-menu-icon rich-menu-item-icon ")
+ .append(getStringAttributeOrEmptyString(menuItem, "iconClass") + "'; ");
scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":anchor').className='dr-menu-label rich-menu-item-label'; ")
.append(getStringAttributeOrEmptyString(menuItem, "onmouseout"));
variables.setVariable("onmouseout", scriptValue);
@@ -125,11 +124,9 @@
scriptValue.append("this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover ")
.append(getStringAttributeOrEmptyString(menuItem, "styleClass") + " ")
.append(getStringAttributeOrEmptyString(menuItem, "selectClass") + "'; ");
- processInlineStyles(context, menuItem, scriptValue, true);
- //if (null == getIconFacet(menuItem)) {
- scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":icon').className='dr-menu-icon dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected ")
- .append(getStringAttributeOrEmptyString(menuItem, "iconClass") + "'; ");
- //}
+ processInlineStyles(context, menuItem, scriptValue, true);
+ scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":icon').className='dr-menu-icon dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected ")
+ .append(getStringAttributeOrEmptyString(menuItem, "iconClass") + "'; ");
scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":anchor').className='dr-menu-label dr-menu-label-selected rich-menu-item-label rich-menu-item-label-selected'; ")
.append(getStringAttributeOrEmptyString(menuItem, "onmouseout"));
variables.setVariable("onmouseover", scriptValue);
@@ -143,13 +140,13 @@
variables.setVariable("iconClass", resource);
resource = "dr-menu-label rich-menu-item-label";
- // + (String) menuItem.getAttributes().get("iconClass");
variables.setVariable("labelClass", resource);
resource = null;
String mode = resolveSubmitMode(menuItem);
if (mode.equalsIgnoreCase(UIMenuItem.MODE_AJAX)) {
resource = AjaxRendererUtils.buildOnClick(menuItem, context).toString();
+ //resource += "; Exadel.Menu.Layers.shutdown();return false;";
} else if (mode.equalsIgnoreCase(UIMenuItem.MODE_SERVER)) {
CommandScriptBuilder builder = new CommandScriptBuilder(menuItem);
builder.setCheckActionAndListener(true);
@@ -160,7 +157,7 @@
builder.setUseOriginalOnclick(true);
builder.addCodeBefore("Event.stop(event || window.event);");
//builder.addCodeAfter("Exadel.Menu.Layers.shutdown();return false;");
- String id = menuItem.getClientId(context);// + ":submit";
+ String id = menuItem.getClientId(context);
builder.addParameter(id + ":hidden", id);
resource = builder.toString();
}
17 years, 9 months
JBoss Rich Faces SVN: r244 - trunk/richfaces/menu-components/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-04-03 09:48:54 -0400 (Tue, 03 Apr 2007)
New Revision: 244
Modified:
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
MenuItem component development.
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2007-04-03 12:51:47 UTC (rev 243)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2007-04-03 13:48:54 UTC (rev 244)
@@ -14,7 +14,7 @@
<h:scripts>
new org.ajax4jsf.framework.resource.PrototypeScript(),
new org.ajax4jsf.framework.ajax.AjaxScript(),
- new org.ajax4jsf.framework.util.command.CommandScript(),
+ new org.ajax4jsf.framework.util.command.CommandScript()
</h:scripts>
<f:call name="initializeResources" />
@@ -25,11 +25,20 @@
onmouseout="#{onmouseout}"
onmouseover="#{onmouseover}"
style="#{component.attributes['style']}"
- onclick="#{onclick}"
- >
-
+ onclick="#{onclick}">
+ <jsp:scriptlet><![CDATA[
+ if (!((org.richfaces.component.UIMenuItem) component).isDisabled()) {
+ ]]></jsp:scriptlet>
+ <f:call name="utils.encodeAttributes">
+ <f:parameter value="onmousedown,onmouseup,onmousemove" />
+ </f:call>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
+
<span id="#{clientId}:icon"
- class="#{iconClass}">
+ class="#{iconClass}"
+ style="#{component.attributes['iconStyle']}">
<jsp:scriptlet><![CDATA[
UIComponent iconFacet = getIconFacet((org.richfaces.component.UIMenuItem) component);
if (null != iconFacet) {
@@ -37,8 +46,7 @@
} else {
]]></jsp:scriptlet>
<img width="16"
- height="16"
- style="#{component.attributes['iconStyle']}"
+ height="16"
src="#{icon}" />
<jsp:scriptlet><![CDATA[
}
17 years, 9 months
JBoss Rich Faces SVN: r243 - in trunk/richfaces/suggestionbox/src/test: resources/WEB-INF and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-04-03 08:51:47 -0400 (Tue, 03 Apr 2007)
New Revision: 243
Added:
trunk/richfaces/suggestionbox/src/test/resources/WEB-INF/log4j.xml
Modified:
trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
Log:
test updated
Modified: trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
===================================================================
--- trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2007-04-03 11:51:34 UTC (rev 242)
+++ trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2007-04-03 12:51:47 UTC (rev 243)
@@ -23,44 +23,55 @@
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
import junit.framework.Assert;
-import org.ajax4jsf.framework.ajax.AjaxViewHandler;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.shale.test.mock.MockViewHandler;
+import org.apache.commons.lang.StringUtils;
import org.richfaces.component.html.HtmlSuggestionBox;
import org.richfaces.renderkit.html.SuggestionBoxRenderer;
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
-import javax.faces.component.UIViewRoot;
import javax.faces.component.html.HtmlInputText;
-import javax.faces.context.FacesContext;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
+import java.util.Set;
/**
- * Unit test for simple Component.
+ * Unit test for SuggestionBox component.
*/
public class SuggestionBoxComponentTest extends AbstractAjax4JsfTestCase {
+ static Set sbScripts = new HashSet();
+ static {
+ sbScripts.add("org.ajax4jsf.framework.ajax.AjaxScript");
+ sbScripts.add("prototype.js");
+ sbScripts.add("org.ajax4jsf.framework.resource.SmartPositionScript");
+ sbScripts.add("org/richfaces/renderkit/html/scripts/browser_info.js");
+ sbScripts.add("org/richfaces/renderkit/html/scripts/scriptaculo.js");
+ sbScripts.add("org/richfaces/renderkit/html/scripts/suggestionbox.js");
+ sbScripts.add("org/richfaces/renderkit/html/scripts/suggestionbox.js");
+ }
- HtmlSuggestionBox htmlSuggestionBox;
- UIForm form;
+ HtmlSuggestionBox sb;
+ UIComponent form;
+ UIComponent input;
/**
* Create the test case
*
* @param testName name of the test case
*/
- public SuggestionBoxComponentTest( String testName ) {
- super( testName );
+ public SuggestionBoxComponentTest(String testName) {
+ super(testName);
}
public void setUp() throws Exception {
super.setUp();
- application.setViewHandler(new AjaxViewHandler(new MyMockViewHandler()));
- UIComponent form = createComponent(UIForm.COMPONENT_TYPE, UIForm.class.getName(), null, null , null);
- UIComponent input = createComponent(HtmlInputText.COMPONENT_TYPE, HtmlInputText.class.getName(), null, null , null);
+ form = createComponent(UIForm.COMPONENT_TYPE, UIForm.class.getName(), null, null, null);
+ input = createComponent(HtmlInputText.COMPONENT_TYPE, HtmlInputText.class.getName(), null, null, null);
form.setId("form");
input.setId("text");
@@ -68,76 +79,83 @@
form.getChildren().add(input);
- htmlSuggestionBox = new HtmlSuggestionBox();
- htmlSuggestionBox.setId("suggestionBox");
- htmlSuggestionBox.setFor(input.getId());
- htmlSuggestionBox.setRendererType("suggestionBoxRenderer");
- renderKit.addRenderer(HtmlSuggestionBox.COMPONENT_FAMILY, "suggestionBoxRenderer", new SuggestionBoxRenderer());
+ sb = new HtmlSuggestionBox();
+ sb.setId("suggestionBox");
+ sb.setFor(input.getId());
+ sb.setRendererType(HtmlSuggestionBox.COMPONENT_TYPE);
+ renderKit.addRenderer(HtmlSuggestionBox.COMPONENT_FAMILY, HtmlSuggestionBox.COMPONENT_TYPE, new SuggestionBoxRenderer());
- form.getChildren().add(htmlSuggestionBox);
+ form.getChildren().add(sb);
}
public void tearDown() throws Exception {
super.tearDown();
- htmlSuggestionBox = null;
+ sb = null;
form = null;
+ input = null;
}
+
/**
* Rigourous Test :-)
+ *
* @throws Exception
*/
public void testRender() throws Exception {
HtmlPage page = renderView();
Assert.assertNotNull(page);
System.out.println(page.asXml());
- HtmlElement div = page.getHtmlElementById("form:suggestionBox");
+ HtmlElement div = page.getHtmlElementById(form.getId() + ":" + sb.getId());
Assert.assertNotNull(div);
Assert.assertEquals("div", div.getNodeName());
+ Assert.assertEquals("dr-sb-common-container rich-sb-common-container", div.getAttributeValue("class"));
+ HtmlElement table = page.getHtmlElementById(form.getId() + ":" + sb.getId() + ":suggest");
+ Assert.assertNotNull(table);
+ Assert.assertEquals("table", table.getNodeName());
+ HtmlElement iframe = page.getHtmlElementById(form.getId() + ":" + sb.getId() + "_iframe");
+ Assert.assertNotNull(iframe);
+ Assert.assertEquals("iframe", iframe.getNodeName());
}
/**
* Rigourous Test :-)
+ *
* @throws Exception
*/
public void testRenderStyle() throws Exception {
HtmlPage page = renderView();
Assert.assertNotNull(page);
- List elementsByTagName = page.getDocumentElement().getHtmlElementsByTagName("link");
- Assert.assertEquals(1, elementsByTagName.size());
- HtmlElement link = (HtmlElement) elementsByTagName.get(0);
+ List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ Assert.assertEquals(1, links.size());
+ HtmlElement link = (HtmlElement) links.get(0);
Assert.assertTrue(link.getAttributeValue("href").contains("org/richfaces/renderkit/html/css/suggestionbox.xcss"));
}
/**
* Rigourous Test :-)
+ *
* @throws Exception
*/
- public void testRenderAttributes() throws Exception {
- /*
- Object[][] attributes ={{"style","xxx","style","xxx"},{"onclick","alert()","onclick","alert()"},{"styleClass","yyy","class","dr-pnl rich-panel yyy"}};
- for (int i = 0; i < attributes.length; i++) {
- Object[] attr = attributes[i];
- htmlSuggestionBox.getAttributes().put(attr[0], attr[1]);
- }
+ public void testRenderScript() throws Exception {
HtmlPage page = renderView();
Assert.assertNotNull(page);
- System.out.println(page.asXml());
- HtmlElement div = page.getHtmlElementById("form:suggestionBox");
- Assert.assertNotNull(div);
- for (int i = 0; i < attributes.length; i++) {
- Object[] attr = attributes[i];
- Assert.assertEquals(attr[3],div.getAttributeValue((String) attr[2]));
- }
- */
- }
+ List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
- class MyMockViewHandler extends MockViewHandler {
- public UIViewRoot restoreView(FacesContext context, String viewId) {
- return null;
- }
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = sbScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
- public void writeState(FacesContext context) {
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+ assertTrue(found);
+ }
}
}
}
Added: trunk/richfaces/suggestionbox/src/test/resources/WEB-INF/log4j.xml
===================================================================
--- trunk/richfaces/suggestionbox/src/test/resources/WEB-INF/log4j.xml (rev 0)
+++ trunk/richfaces/suggestionbox/src/test/resources/WEB-INF/log4j.xml 2007-04-03 12:51:47 UTC (rev 243)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "file:///eclipse/dtdcache/log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <!-- This is a sample configuration for log4j.
+ It simply just logs everything into a single
+ log file.
+ Note, that you can use properties for value substitution.
+ -->
+ <appender name="DEFAULT" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
+ </layout>
+ </appender>
+
+<!--
+ <appender name="FACES" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
+ </layout>
+ </appender>
+
+ <appender name="CHAMELEON" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
+ </layout>
+ </appender>
+ -->
+ <category name="com.sun.faces">
+ <priority value="DEBUG" />
+ <appender-ref ref="DEFAULT"/>
+ </category>
+
+ <category name="org.apache.myfaces">
+ <priority value="DEBUG" />
+ <appender-ref ref="DEFAULT"/>
+ </category>
+
+ <category name="javax.faces">
+ <priority value="INFO" />
+ <appender-ref ref="DEFAULT"/>
+ </category>
+
+ <category name="faces">
+ <priority value="INFO" />
+ <appender-ref ref="DEFAULT"/>
+ </category>
+
+ <category name="com.exadel.vcp">
+ <priority value="DEBUG" />
+ <appender-ref ref="DEFAULT"/>
+ </category>
+
+
+ <category name="org.ajax4jsf">
+ <priority value="DEBUG" />
+ <appender-ref ref="DEFAULT"/>
+ </category>
+
+ <!--
+ <root>
+ <priority value ="info" />
+ <appender-ref ref="DEFAULT" />
+ </root>
+ -->
+</log4j:configuration>
17 years, 9 months
JBoss Rich Faces SVN: r242 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-04-03 07:51:34 -0400 (Tue, 03 Apr 2007)
New Revision: 242
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
changing in positioning menuGroup
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-03 10:26:40 UTC (rev 241)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-03 11:51:34 UTC (rev 242)
@@ -470,9 +470,48 @@
var left = screenOffset[0] + scrolls.left;
var right = left + dim.width;
var layerdim = Element.getDimensions(this.layer);
+
+ var options = Exadel.Menu.Layers.layers[this.layer.id].options;
+ var dir = 0;
+ if (options.direction) {
+ dir = options.direction.toUpperCase().indexOf('LEFT')!=-1?1:dir;
+ dir = options.direction.toUpperCase().indexOf('RIGHT')!=-1?2:dir;
+ }
+
var layerLeft = right;
+ var layerTop = top;
+
+ if (dir == 0) {
+ if (layerLeft + layerdim.width >= windowWidth) {
+ var invisibleRight = layerLeft + layerdim.width - windowWidth;
+ layerLeft = left - layerdim.width;
+ }
+
+ if (layerLeft < 0) {
+ if (Math.abs(layerLeft) > invisibleRight) {
+ layerLeft = right;
+ }
+ }
+
+ if (layerTop + layerdim.height >= windowHeight) {
+ var invisibleBottom = layerTop + layerdim.height - windowHeight;
+ var items = this.layer.firstChild.childNodes;
+ if (items.length > 0) {
+ var lastItem = items[items.length-1];
+ var layerOffset = Position.cumulativeOffset(this.layer);
+ var itemOffset = Position.cumulativeOffset(lastItem);
+ layerTop = top -(itemOffset[1]-layerOffset[1]);
+ if (layerTop < 0) {
+ if (Math.abs(layerTop) > invisibleBottom) layerTop = top;
+ }
+ }
+
+ }
+ } else if (dir == 1) {
+ layerLeft = left - layerdim.width;
+ }
- if (layerLeft + layerdim.width >= windowWidth) {
+/* if (layerLeft + layerdim.width >= windowWidth) {
layerLeft = left - layerdim.width + Exadel.Menu.Layers.shadowWidth;
}
@@ -499,10 +538,10 @@
if (layertop < 0) {
layertop = 0;
- }
+ } */
this.layer.style.left = layerLeft + "px";
- this.layer.style.top = layertop + "px";
+ this.layer.style.top = layerTop + "px";
}
/**
* set to true when a dropdown box inside menu receives focus
@@ -574,7 +613,7 @@
Exadel.Menu.Layer.prototype = {
- initialize: function(id,delay){
+ initialize: function(id,delay, hideDelay){
Exadel.Menu.Layers.listl.push(id);
this.id = id;
this.layer = $(id);
@@ -747,7 +786,8 @@
Exadel.Menu.Layers.LMPopUpL(this.id, false);
},
- asDropDown: function(topLevel, onEvt, offEvt){
+ asDropDown: function(topLevel, onEvt, offEvt, options){
+ this.options = options || {};
// if($(topLevel)){ CH-1518
var onmouseover = function(e){
if (!e) {
@@ -784,7 +824,8 @@
// }
return this;
},
- asSubMenu: function(parent, refLayerName, evtName){
+ asSubMenu: function(parent, refLayerName, evtName, options){
+ this.options = options || {};
if(!evtName){
evtName = 'onmouseover';
}
17 years, 9 months
JBoss Rich Faces SVN: r241 - trunk/richfaces/menu-components/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-04-03 06:26:40 -0400 (Tue, 03 Apr 2007)
New Revision: 241
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
Log:
Development - set default in atributs
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-04-03 10:23:10 UTC (rev 240)
+++ trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-04-03 10:26:40 UTC (rev 241)
@@ -73,36 +73,35 @@
<description>Delay between event and menu showing.</description>
<defaultvalue><![CDATA[new Integer(300)]]></defaultvalue>
</property>
- <property>
- <name>hideDelay</name>
- <classname>java.lang.Integer</classname>
- <description>Delay between losing focus and menu closing.</description>
- <defaultvalue><![CDATA[new Integer(300)]]></defaultvalue>
- </property>
<property>
<name>onmousemove</name>
<classname>java.lang.String</classname>
<description>HTML: a script expression; a pointer is moved within</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>onmouseout</name>
<classname>java.lang.String</classname>
<description>HTML: a script expression; a pointer is moved away</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>onmouseover</name>
<classname>java.lang.String</classname>
<description>HTML: a script expression; a pointer is moved onto</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>onopen</name>
<classname>java.lang.String</classname>
<description>HTML: script expression; group was opened.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>onclose</name>
<classname>java.lang.String</classname>
<description>HTML: script expression; group was closed.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
17 years, 9 months
JBoss Rich Faces SVN: r240 - in trunk/richfaces/dropdown-menu/src/main: java/org/richfaces/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-04-03 06:23:10 -0400 (Tue, 03 Apr 2007)
New Revision: 240
Modified:
trunk/richfaces/dropdown-menu/src/main/config/component/dropdownmenu.xml
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
Log:
Development add events attributes in javascript
Modified: trunk/richfaces/dropdown-menu/src/main/config/component/dropdownmenu.xml
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/config/component/dropdownmenu.xml 2007-04-03 00:50:12 UTC (rev 239)
+++ trunk/richfaces/dropdown-menu/src/main/config/component/dropdownmenu.xml 2007-04-03 10:23:10 UTC (rev 240)
@@ -79,6 +79,7 @@
<description>
Defines direction of the popup list to appear (top-right, top-left bottom-right, bottom-left, auto(default))
</description>
+ <defaultvalue>"auto"</defaultvalue>
</property>
@@ -96,6 +97,7 @@
<description>
Set the corner of the label for the popup to be connected with. (auto(default), tr, tl, bl, br, where tr – top-right)
</description>
+ <defaultvalue>"auto"</defaultvalue>
</property>
<property>
@@ -104,6 +106,7 @@
<description>
Sets the horizontal offset between popup list and label element conjunction point
</description>
+ <defaultvalue><![CDATA[0]]></defaultvalue>
</property>
<property>
@@ -112,15 +115,9 @@
<description>
Sets the vertical offset between popup list and label element conjunction point
</description>
+ <defaultvalue><![CDATA[0]]></defaultvalue>
</property>
- <property>
- <name>verticalOffset</name>
- <classname>int</classname>
- <description>
- Sets the vertical offset between popup list and label element conjunction point
- </description>
- </property>
&html_style_attributes;
@@ -172,6 +169,7 @@
<description>
Event must occurs on menu closure
</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -180,6 +178,7 @@
<description>
Event must occurs on menu opening
</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
@@ -189,6 +188,7 @@
<description>
HTML: script expression; a pointer was moved away.
</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -197,6 +197,7 @@
<description>
HTML: script expression; a pointer was moved within.
</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -205,6 +206,7 @@
<description>
HTML: script expression; a pointer was moved onto.
</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -213,6 +215,7 @@
<description>
HTML: script expression; some item was selected.
</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -221,6 +224,7 @@
<description>
HTML: script expression; some group was activated.
</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
Modified: trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-04-03 00:50:12 UTC (rev 239)
+++ trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-04-03 10:23:10 UTC (rev 240)
@@ -127,16 +127,42 @@
StringBuffer buffer =
new StringBuffer("new Exadel.Menu.Layer('")
.append(component.getClientId(context)+"_menu")
- .append("',")
+ .append("','")
.append(component.getAttributes().get("showDelay"))
- .append( ")");
+ .append("',");
+ if (component instanceof UIDropDownMenu) {
+ buffer.append("'")
+ .append(component.getAttributes().get("hideDelay"))
+ .append("'");
+ }
+ else{
+ buffer.append("null");
+ }
+ buffer.append( ")");
if (component instanceof UIMenuGroup) {
buffer.append(".asSubMenu('")
.append(component.getParent().getClientId(context)+"_menu")
.append("','")
.append("ref")
.append(component.getClientId(context))
- .append("')");
+ .append("',");
+ String evt = (String) component.getAttributes().get("event");
+ if(evt == null || evt.trim().length() == 0){
+ evt = "onmouseover";
+ }
+ buffer.append("'").append(evt).append("',")
+ .append("{")
+ .append("onmouseout:'" + component.getAttributes().get("onmouseout")+"'")
+ .append(",")
+ .append("onmousemove:'" + component.getAttributes().get("onmousemove")+"'")
+ .append(",")
+ .append("onmouseover:'" + component.getAttributes().get("onmouseover")+"'")
+ .append(",")
+ .append("onopen:'" + component.getAttributes().get("onopen")+"'")
+ .append(",")
+ .append("onclose:'" + component.getAttributes().get("onclose")+"'")
+ .append("}")
+ .append(")");
} else {
buffer
.append(".asDropDown('")
@@ -147,8 +173,31 @@
if(evt == null || evt.trim().length() == 0){
evt = "onmouseover";
}
- buffer.append(",'").append(evt).append("')");
-
+ buffer.append(",'").append(evt).append("','onmouseout',")
+ .append("{")
+ .append("direction:'" + component.getAttributes().get("direction")+"'")
+ .append(",")
+ .append("jointPoint:'" + component.getAttributes().get("jointPoint")+"'")
+ .append(",")
+ .append("verticalOffset:'" + component.getAttributes().get("verticalOffset")+"'")
+ .append(",")
+ .append("horizontalOffset:'" + component.getAttributes().get("horizontalOffset")+"'")
+ .append(",")
+ .append("oncollapse:'" + component.getAttributes().get("oncollapse")+"'")
+ .append(",")
+ .append("onexpand:'" + component.getAttributes().get("onexpand")+"'")
+ .append(",")
+ .append("onmouseout:'" + component.getAttributes().get("onmouseout")+"'")
+ .append(",")
+ .append("onmousemove:'" + component.getAttributes().get("onmousemove")+"'")
+ .append(",")
+ .append("onmouseover:'" + component.getAttributes().get("onmouseover")+"'")
+ .append(",")
+ .append("onitemselect:'" + component.getAttributes().get("onitemselect")+"'")
+ .append(",")
+ .append("ongroupactivate:'" + component.getAttributes().get("ongroupactivate")+"'")
+ .append("}")
+ .append(")");
}
List children = component.getChildren();
for(Iterator it = children.iterator();it.hasNext();) {
17 years, 9 months
JBoss Rich Faces SVN: r239 - in trunk/richfaces/tree/src: test/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-04-02 20:50:12 -0400 (Mon, 02 Apr 2007)
New Revision: 239
Modified:
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeDataModelEventNavigator.java
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeModelTest.java
Log:
Redundant methods removed
Test for constrained walk added
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeDataModelEventNavigator.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeDataModelEventNavigator.java 2007-04-03 00:33:01 UTC (rev 238)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeDataModelEventNavigator.java 2007-04-03 00:50:12 UTC (rev 239)
@@ -23,8 +23,6 @@
import java.io.IOException;
-import javax.faces.context.FacesContext;
-
import org.richfaces.component.LastElementAware;
import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
@@ -45,13 +43,11 @@
private TreeRowKey rowKey;
private UITree tree;
- private FacesContext facesContext;
- public TreeDataModelEventNavigator(UITree tree, FacesContext context, TreeRowKey floatingKey) {
+ public TreeDataModelEventNavigator(UITree tree, TreeRowKey floatingKey) {
super();
this.tree = tree;
this.rowKey = (TreeRowKey) this.tree.getRowKey();
- this.facesContext = context;
this.floatingKey = floatingKey;
}
@@ -120,10 +116,6 @@
return tree;
}
- protected FacesContext getFacesContext() {
- return facesContext;
- }
-
public void setLastElement() {
lastElement = true;
}
@@ -137,10 +129,6 @@
return this.rowKey;
}
- protected boolean isLastElement() {
- return lastElement;
- }
-
protected boolean isStackedLastElement() {
if (stackedLast != null) {
return stackedLast.booleanValue();
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-04-03 00:33:01 UTC (rev 238)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-04-03 00:50:12 UTC (rev 239)
@@ -309,7 +309,7 @@
TreeRowKey rowKey = (TreeRowKey) key;
final TreeDataModelEventNavigator levelNavigator = new TreeDataModelEventNavigator(
- input, context, rowKey) {
+ input, rowKey) {
public void afterDown() throws IOException {
openLevelDownTable(context, input, writer);
Modified: trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeModelTest.java
===================================================================
--- trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeModelTest.java 2007-04-03 00:33:01 UTC (rev 238)
+++ trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeModelTest.java 2007-04-03 00:50:12 UTC (rev 239)
@@ -22,7 +22,9 @@
import java.io.IOException;
import java.io.InputStream;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import javax.faces.context.FacesContext;
@@ -111,6 +113,26 @@
model.setRowKey(new ListRowKey("testId:1:1"));
assertEquals(".xhtml", ((XmlNodeData) model.getRowData()).getText());
}
+
+ public void testWalkConstrained() throws Exception {
+ model.setWrappedData(node);
+
+ Walker2 walker = new Walker2(model);
+ model.walk(null, walker, null, new ListRowKey("testId:4"), null, false);
+
+ List walked = walker.getWalked();
+ assertEquals(3, walked.size());
+
+ model.setRowKey(new ListRowKey("testId:4"));
+ assertSame(walked.get(0), model.getTreeNode());
+
+ model.setRowKey(new ListRowKey("testId:4:0"));
+ assertSame(walked.get(1), model.getTreeNode());
+
+ model.setRowKey(new ListRowKey("testId:4:1"));
+ assertSame(walked.get(2), model.getTreeNode());
+ }
+
}
abstract class Walker1 implements DataVisitor, LastElementAware {
@@ -137,3 +159,24 @@
return last;
}
}
+
+class Walker2 implements DataVisitor {
+ private List walked = new ArrayList();
+ private AbstractTreeDataModel model;
+
+ public Walker2(AbstractTreeDataModel model) {
+ super();
+ this.model = model;
+ }
+
+ public void process(FacesContext context, Object rowKey, Object argument)
+ throws IOException {
+
+ model.setRowKey(rowKey);
+ walked.add(model.getTreeNode());
+ }
+
+ public List getWalked() {
+ return walked;
+ }
+}
17 years, 9 months