JBoss Rich Faces SVN: r288 - trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-04-05 10:45:16 -0400 (Thu, 05 Apr 2007)
New Revision: 288
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-05 14:26:13 UTC (rev 287)
+++ trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2007-04-05 14:45:16 UTC (rev 288)
@@ -50,7 +50,6 @@
javaScripts.add("org/richfaces/renderkit/html/scripts/browser_info.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/scriptaculo.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/suggestionbox.js");
- javaScripts.add("org/richfaces/renderkit/html/scripts/suggestionbox.js");
}
private HtmlSuggestionBox sb;
19 years
JBoss Rich Faces SVN: r287 - 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-05 10:26:13 -0400 (Thu, 05 Apr 2007)
New Revision: 287
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
support "jointPoint" and "direction" attributes added
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-05 14:12:53 UTC (rev 286)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-05 14:26:13 UTC (rev 287)
@@ -237,7 +237,7 @@
this.shutdown();
this.detectWidth();
this.LMPopUp(menuName, false);
- this.setLMTO(4*this.timeoutLength);
+ this.setLMTO(4);
}
};
@@ -389,7 +389,62 @@
this.layer = $(layer);
Event.stop(e);
+ this.listPositions = function(jp, dir) {
+ var poss = new Array(new Array(2,1,4),new Array(1,2,3),new Array(4,3,2),new Array(3,4,1));
+ var list = new Array();
+ if (jp>0 && dir>0) {
+ list.push({jointPoint: jp, direction: dir });
+ } else if (jp>0 && dir==0) {
+ for(var i=0;i<3;i++) {
+ list.push({jointPoint: jp, direction: poss[jp-1][i] });
+ }
+ } else if (jp==0 && dir>0) {
+ for(var i=0;i<3;i++) {
+ list.push({jointPoint: poss[dir-1][i], direction: dir });
+ }
+ } else if (jp==0 && dir==0) {
+ list.push({jointPoint: 4, direction: 3 });
+ list.push({jointPoint: 1, direction: 2 });
+ list.push({jointPoint: 3, direction: 4 });
+ list.push({jointPoint: 2, direction: 1 });
+ }
+ return list;
+ }.bind(this);
+ this.calcPosition = function(jp, dir) {
+ var layerLeft;
+ var layerTop;
+ switch (jp) {
+ case 1:
+ layerLeft = this.left;
+ layerTop = this.top;
+ break;
+ case 2:
+ layerLeft = this.right;
+ layerTop = this.top;
+ break;
+ case 3:
+ layerLeft = this.right;
+ layerTop = this.bottom;
+ break;
+ case 4:
+ layerLeft = this.left;
+ layerTop = this.bottom;
+ break;
+ }
+ switch (dir) {
+ case 1:
+ layerLeft -= this.layerdim.width;
+ layerTop -= this.layerdim.height;
+ break;
+ case 2:
+ layerTop -= this.layerdim.height;
+ break;
+ case 4:
+ layerLeft -= this.layerdim.width;
+ }
+ return {left: layerLeft, top: layerTop};
+ }.bind(this);
this.show = function() {
Exadel.Menu.Layers.shutdown();
@@ -405,54 +460,53 @@
var dim = Element.getDimensions(this.element);
// parent element
- var top = screenOffset[1];
- var left = screenOffset[0];
- //var top = 0;
- //var left = 0;
+ this.top = screenOffset[1];
+ this.left = screenOffset[0];
- var bottom = top + dim.height;
- var right = left + dim.width;
+ this.bottom = this.top + dim.height;
+ this.right = this.left + dim.width;
- var layerdim = Element.getDimensions(this.layer);
- var layerLeft = Math.max(left,winOffset.left);
+ this.layerdim = Element.getDimensions(this.layer);
- if (layerLeft + layerdim.width - winOffset.left > windowWidth) {
- layerLeft = right - layerdim.width + Exadel.Menu.Layers.shadowWidth;
+ var options = Exadel.Menu.Layers.layers[this.layer.id].options;
+
+ var jointPoint = 0;
+ if (options.jointPoint) {
+ var sJp = options.jointPoint.toUpperCase();
+ jointPoint = sJp.indexOf('TL') != -1?1:jointPoint;
+ jointPoint = sJp.indexOf('TR') != -1?2:jointPoint;
+ jointPoint = sJp.indexOf('BR') != -1?3:jointPoint;
+ jointPoint = sJp.indexOf('BL') != -1?4:jointPoint;
}
-
- if (layerLeft + layerdim.width - winOffset.left > windowWidth) {
-// layerLeft = windowWidth - layerdim.width;
- layerLeft = windowWidth + winOffset.left - layerdim.width;
+
+ var direction = 0;
+ if (options.direction) {
+ var sDir = options.direction.toUpperCase();
+ direction = sDir.indexOf('TOP-LEFT') != -1?1:direction;
+ direction = sDir.indexOf('TOP-RIGHT') != -1?2:direction;
+ direction = sDir.indexOf('BOTTOM-RIGHT')!= -1?3:direction;
+ direction = sDir.indexOf('BOTTOM-LEFT') != -1?4:direction;
}
-
- if (layerLeft < 0) {
- layerLeft = 0;
+
+ var listPos = this.listPositions(jointPoint, direction);
+ var layerPos;
+ var foundPos = false;
+ for (var i=0;i<listPos.length;i++) {
+ layerPos = this.calcPosition(listPos[i].jointPoint, listPos[i].direction)
+ if ((layerPos.left >= winOffset.left) &&
+ (layerPos.left + this.layerdim.width - winOffset.left <= windowWidth) &&
+ (layerPos.top >= winOffset.top) &&
+ (layerPos.top + this.layerdim.height - winOffset.top <= windowHeight)) {
+ foundPos = true;
+ break;
+ }
}
-
-
-
- // calculate top of layer
- var layerTop = bottom;
-
- if ( (layerdim.height + 20) < (win.height - (bottom-winOffset.top)) ) {
- layerTop = bottom;
- } else {
- if ( (top-winOffset.top) > (layerdim.height + 20) ) {
- layerTop = top - layerdim.height;
- } else {
- layerTop = windowHeight - 20 - layerdim.height + winOffset.top;
- } // else
- } // else
-
- // fixing negative layerTop
- if (layerTop < 0) {
- layerTop = 0;
+ if (!foundPos) {
+ layerPos = this.calcPosition(listPos[0].jointPoint, listPos[0].direction)
}
-
- this.layer.style.left = layerLeft + "px";
- this.layer.style.top = layerTop + "px";
-
-
+ this.layer.style.left = layerPos.left + "px";
+ this.layer.style.top = layerPos.top + "px";
+
Exadel.Menu.Layers.LMPopUp(this.layer.id, false);
Exadel.Menu.Layers.clearLMTO();
}.bind(this);
@@ -465,7 +519,6 @@
this.event = e;
this.element = Event.findElement(e, 'div');
-// .childNodes[2].firstChild;
this.layer = $(layer);
this.show = function() {
19 years
JBoss Rich Faces SVN: r286 - in trunk/richfaces-samples/dropdownmenu-sample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-04-05 10:12:53 -0400 (Thu, 05 Apr 2007)
New Revision: 286
Modified:
trunk/richfaces-samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java
trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp
Log:
possibility to test "jointPoint" and "direction" attributes added
Modified: trunk/richfaces-samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java
===================================================================
--- trunk/richfaces-samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java 2007-04-05 14:00:19 UTC (rev 285)
+++ trunk/richfaces-samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java 2007-04-05 14:12:53 UTC (rev 286)
@@ -30,6 +30,9 @@
public class Bean {
private String width = "200px";
+ private String jointPoint = "auto";
+ private String direction = "auto";
+ private String groupDirection = "auto";
public String getWidth() {
return width;
@@ -39,6 +42,30 @@
this.width = width;
}
+ public String getJointPoint() {
+ return jointPoint;
+ }
+
+ public void setJointPoint(String jointPoint) {
+ this.jointPoint = jointPoint;
+ }
+
+ public String getDirection() {
+ return direction;
+ }
+
+ public void setDirection(String direction) {
+ this.direction = direction;
+ }
+
+ public String getGroupDirection() {
+ return groupDirection;
+ }
+
+ public void setGroupDirection(String direction) {
+ this.groupDirection = direction;
+ }
+
public void actionListener(ActionEvent event) {
System.out.println("ActionEvent on " + event.getComponent().getId() + " & Phase is "+ event.getPhaseId());
}
Modified: trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp 2007-04-05 14:00:19 UTC (rev 285)
+++ trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp 2007-04-05 14:12:53 UTC (rev 286)
@@ -17,12 +17,12 @@
<h:commandLink action="#{skinBean.change}" value="set skin"/>
<h:panelGrid id="grid" columns="2" cellspacing="4">
- <ddm:dropDownMenu id="MenuItem1" popupWidth="#{bean.width}" value="Item1">
+ <ddm:dropDownMenu id="MenuItem1" popupWidth="#{bean.width}" value="Item1" jointPoint="#{bean.jointPoint}" direction="#{bean.direction}">
<mc:menuItem id="menuItem11" value="Active11: ajax" mode="ajax" actionListener="#{bean.actionListener}"/>
<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">
+ <mc:menuGroup id="menuGroup1" value="Group1" direction="#{bean.groupDirection}">
<mc:menuItem id="menuGroup1Item1" value="Active"/>
<mc:menuItem id="menuGroup1Item2" value="Active" icon="/images/ico1.gif"/>
<mc:menuItem id="menuGroup1Item3" value="Active"/>
@@ -37,7 +37,7 @@
</mc:menuItem>
</ddm:dropDownMenu>
- <ddm:dropDownMenu id="MenuItem2" popupWidth="#{bean.width}">
+ <ddm:dropDownMenu id="MenuItem2" popupWidth="#{bean.width}" jointPoint="#{bean.jointPoint}" direction="#{bean.direction}">
<f:facet name="label">
<f:verbatim>Item2</f:verbatim>
</f:facet>
@@ -51,7 +51,7 @@
</mc:menuItem>
<mc:menuItem id="menuItem24" value="Active24"/>
- <mc:menuGroup id="menuGroup2" value="Group2">
+ <mc:menuGroup id="menuGroup2" value="Group2" direction="#{bean.groupDirection}">
<mc:menuItem id="menuGroup2Item1" value="Active"/>
<mc:menuItem id="menuGroup2Item2" value="Active" icon="/images/ico1.gif"/>
<mc:menuItem id="menuGroup2Item3" value="Active"/>
@@ -84,6 +84,36 @@
</h:selectOneRadio>
</h:panelGroup>
+ <h:panelGroup>
+ <h:outputText value="JointPoint:"/>
+ <h:selectOneRadio value="#{bean.jointPoint}" onclick="submit()">
+ <f:selectItem itemLabel="auto" itemValue="auto"/>
+ <f:selectItem itemLabel="tl" itemValue="tl"/>
+ <f:selectItem itemLabel="tr" itemValue="tr"/>
+ <f:selectItem itemLabel="bl" itemValue="bl"/>
+ <f:selectItem itemLabel="br" itemValue="br"/>
+ </h:selectOneRadio>
+ </h:panelGroup>
+
+ <h:panelGroup>
+ <h:outputText value="Menu direction:"/>
+ <h:selectOneRadio value="#{bean.direction}" onclick="submit()">
+ <f:selectItem itemLabel="auto" itemValue="auto"/>
+ <f:selectItem itemLabel="top-left" itemValue="top-left"/>
+ <f:selectItem itemLabel="top-right" itemValue="top-right"/>
+ <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"/>
+ <f:selectItem itemLabel="bottom-right" itemValue="bottom-right"/>
+ </h:selectOneRadio>
+ </h:panelGroup>
+
+ <h:panelGroup>
+ <h:outputText value="MenuGroup direction:"/>
+ <h:selectOneRadio value="#{bean.groupDirection}" onclick="submit()">
+ <f:selectItem itemLabel="auto" itemValue="auto"/>
+ <f:selectItem itemLabel="left" itemValue="left"/>
+ <f:selectItem itemLabel="right" itemValue="right"/>
+ </h:selectOneRadio>
+ </h:panelGroup>
</h:form>
</f:view>
</body>
19 years
JBoss Rich Faces SVN: r285 - trunk/richfaces/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script.
by richfaces-svn-commits@lists.jboss.org
Author: pkotikov
Date: 2007-04-05 10:00:19 -0400 (Thu, 05 Apr 2007)
New Revision: 285
Modified:
trunk/richfaces/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
Log:
https://jira.exadel.com/browse/RFA-336
Modified: trunk/richfaces/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
===================================================================
--- trunk/richfaces/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2007-04-05 13:39:19 UTC (rev 284)
+++ trunk/richfaces/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2007-04-05 14:00:19 UTC (rev 285)
@@ -92,7 +92,7 @@
_load: function(){
if (this.edited){
if (this.options.disabled){
- this.controls.edit.readOnly = "readOnly";
+ this.controls.edit.disabled = "disabled";
this.controls.edit.style.color = "gray";
} else {
this.controls.edit.readOnly = "";
19 years
JBoss Rich Faces SVN: r284 - trunk/richfaces/separator/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-04-05 09:39:19 -0400 (Thu, 05 Apr 2007)
New Revision: 284
Modified:
trunk/richfaces/separator/src/test/java/org/richfaces/component/SeparatorComponentTest.java
Log:
test updated
Modified: trunk/richfaces/separator/src/test/java/org/richfaces/component/SeparatorComponentTest.java
===================================================================
--- trunk/richfaces/separator/src/test/java/org/richfaces/component/SeparatorComponentTest.java 2007-04-05 13:38:51 UTC (rev 283)
+++ trunk/richfaces/separator/src/test/java/org/richfaces/component/SeparatorComponentTest.java 2007-04-05 13:39:19 UTC (rev 284)
@@ -23,20 +23,14 @@
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.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
import org.richfaces.component.html.HtmlSeparator;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
import javax.faces.component.html.HtmlForm;
import javax.faces.component.html.HtmlOutputText;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
/**
* Unit test for Separator component.
19 years
JBoss Rich Faces SVN: r283 - trunk/richfaces/toolBar/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-04-05 09:38:51 -0400 (Thu, 05 Apr 2007)
New Revision: 283
Removed:
trunk/richfaces/toolBar/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
unused test deleted
Deleted: trunk/richfaces/toolBar/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/richfaces/toolBar/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-04-05 13:38:08 UTC (rev 282)
+++ trunk/richfaces/toolBar/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-04-05 13:38:51 UTC (rev 283)
@@ -1,53 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * 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.component;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import javax.faces.component.UIComponent;
-
-/**
- * Unit test for simple Component.
- */
-public class JSFComponentTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public JSFComponentTest( String testName )
- {
- super( testName );
- }
-
-
- /**
- * Rigourous Test :-)
- */
- public void testComponent()
- {
- assertTrue( true );
- }
-}
19 years
JBoss Rich Faces SVN: r282 - trunk/richfaces/toolBar/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-04-05 09:38:08 -0400 (Thu, 05 Apr 2007)
New Revision: 282
Added:
trunk/richfaces/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java
Log:
test for ToolBar component added
Added: trunk/richfaces/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java
===================================================================
--- trunk/richfaces/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java (rev 0)
+++ trunk/richfaces/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java 2007-04-05 13:38:08 UTC (rev 282)
@@ -0,0 +1,135 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * 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.component;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import junit.framework.Assert;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.html.HtmlToolBar;
+import org.richfaces.component.html.HtmlToolBarGroup;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlCommandButton;
+import javax.faces.component.html.HtmlForm;
+import java.util.List;
+
+/**
+ * Unit test for ToolBar component.
+ */
+public class ToolBarComponentTest extends AbstractAjax4JsfTestCase {
+
+ private HtmlToolBar toolBar;
+ private HtmlToolBarGroup toolBarGroup;
+ private HtmlCommandButton button1;
+ private HtmlCommandButton button2;
+ private UIForm form;
+
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public ToolBarComponentTest(String testName) {
+ super(testName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ toolBar = (HtmlToolBar)application.createComponent(HtmlToolBar.COMPONENT_TYPE);
+ toolBar.setId("toolBar");
+ form.getChildren().add(toolBar);
+
+ button1 = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
+ button1.setValue("Change 1");
+ toolBar.getChildren().add(button1);
+
+ toolBarGroup = (HtmlToolBarGroup)application.createComponent(HtmlToolBarGroup.COMPONENT_TYPE);
+ button2 = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
+ button2.setValue("Change 2");
+ toolBarGroup.getChildren().add(button2);
+
+ toolBar.getChildren().add(toolBarGroup);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+ toolBar = null;
+ toolBarGroup = null;
+ form = null;
+ }
+
+ /**
+ * Test component default values
+ *
+ * @throws Exception
+ */
+ public void testDefaultValues() throws Exception {
+ Assert.assertEquals("100%", toolBar.getWidth());
+ Assert.assertEquals("none", toolBar.getItemSeparator());
+ Assert.assertEquals("none", toolBarGroup.getItemSeparator());
+ Assert.assertEquals("left", toolBarGroup.getLocation());
+ }
+ /**
+ * Test component rendering
+ *
+ * @throws Exception
+ */
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ Assert.assertNotNull(page);
+ System.out.println(page.asXml());
+
+ HtmlElement table = page.getHtmlElementById(form.getId() + ":" + toolBar.getId());
+ Assert.assertNotNull(table);
+ Assert.assertEquals("table", table.getNodeName());
+
+ String classAttr = table.getAttributeValue("class");
+ Assert.assertTrue(classAttr.contains("dr-toolbar-ext"));
+ Assert.assertTrue(classAttr.contains("rich-toolbar"));
+ }
+
+ /**
+ * Test style rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderStyle() throws Exception {
+ HtmlPage page = renderView();
+ Assert.assertNotNull(page);
+ 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/toolBar.xcss"));
+ }
+}
19 years
JBoss Rich Faces SVN: r281 - trunk/richfaces/inputnumber-slider/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: pkotikov
Date: 2007-04-05 09:35:08 -0400 (Thu, 05 Apr 2007)
New Revision: 281
Modified:
trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
Log:
https://jira.exadel.com/browse/RFA-336
Modified: trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-04-05 12:56:57 UTC (rev 280)
+++ trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-04-05 13:35:08 UTC (rev 281)
@@ -45,9 +45,10 @@
boolean showInput = attributeToBoolean(component, "showInput");
boolean manualInput = attributeToBoolean(component, "enableManualInput");
- variables.setVariable("inputReadOnly",
- new Boolean(!manualInput || disabled));
- if (!manualInput || disabled){
+ variables.setVariable("inputReadOnly",new Boolean(!manualInput));
+ variables.setVariable("inputDisabled",new Boolean(disabled));
+
+ if (!manualInput || disabled){
variables.setVariable("color", "color: gray;");
}
else{
@@ -64,6 +65,7 @@
class="dr-insldr-field rich-inslider-field #{component.attributes['inputClass']}"
style="#{component.attributes['inputStyle']} #{color}"
readonly="#{inputReadOnly}"
+ disabled="#{disabled}"
onselect="#{component.attributes['onselect']}"
accesskey="#{component.attributes['accesskey']}"
size="#{component.attributes['inputSize']}"
19 years
JBoss Rich Faces SVN: r280 - in trunk/richfaces/dropdown-menu/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-04-05 08:56:57 -0400 (Thu, 05 Apr 2007)
New Revision: 280
Modified:
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
Development. Has added "hideDelay" functional in javascript
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-05 09:24:16 UTC (rev 279)
+++ trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-04-05 12:56:57 UTC (rev 280)
@@ -137,7 +137,7 @@
function.addParameter(component.getAttributes().get("hideDelay"));
}
else{
- function.addParameter("null");
+ function.addParameter(""+300);
}
function.appendScript(buffer);
if (component instanceof UIMenuGroup) {
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-05 09:24:16 UTC (rev 279)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-05 12:56:57 UTC (rev 280)
@@ -212,11 +212,11 @@
setLMTO: function (ratio) {
if(!ratio){
- ratio = 1;
+ ratio = this.timeoutLength;
}
if (this.useTimeouts) {
clearTimeout(this.timeoutFlag);
- this.timeoutFlag = setTimeout('Exadel.Menu.Layers.shutdown()', this.timeoutLength * ratio);
+ this.timeoutFlag = setTimeout('Exadel.Menu.Layers.shutdown()', ratio);
}
},
@@ -237,7 +237,7 @@
this.shutdown();
this.detectWidth();
this.LMPopUp(menuName, false);
- this.setLMTO(4);
+ this.setLMTO(4*this.timeoutLength);
}
};
@@ -569,67 +569,6 @@
Exadel.Menu.Layer = Class.create();
-Exadel.Menu.Layer.mouseover =
- function(e){
- Exadel.Menu.MouseIn=true;
- Exadel.Menu.Layers.clearLMTO();
- Event.stop(e);
- }.bindAsEventListener();
-
-Exadel.Menu.Layer.mouseout =
- function(e){
- Exadel.Menu.MouseIn = false;
- if (!Exadel.Menu.selectOpen) {
- Exadel.Menu.Layers.setLMTO();
- }
- Event.stop(e);
- }.bindAsEventListener();
-
-Exadel.Menu.Layer.openSelect = function(event){
- Exadel.Menu.selectOpen = true;
- var ClickInput = Exadel.Menu.Layer.ClickInput.bindAsEventListener(this);
- Event.observe(Event.element(event), "click", Exadel.Menu.Layer.ClickInput);
-
-}
-Exadel.Menu.Layer.closeSelect = function(event){
- Exadel.Menu.selectOpen = false;
-
- var ClickInput = Exadel.Menu.Layer.ClickInput.bindAsEventListener(this);
- Event.stopObserving(Event.element(event), "click", Exadel.Menu.Layer.ClickInput);
- if (Exadel.Menu.MouseIn == false){
- Exadel.Menu.Layers.setLMTO();
- }
-}
-
-Exadel.Menu.Layer.OnKeyPress = function(event){
-
- if(event.keyCode==13){
- Exadel.Menu.Layers.setLMTO();
- }
-}
-
-
-Exadel.Menu.Layer.MouseoverInInput = function(event){
-//alert("event rabotaet "+ event.target);
-var ClickInput = Exadel.Menu.Layer.ClickInput.bindAsEventListener(this);
-Event.observe(Event.element(event), "click", Exadel.Menu.Layer.ClickInput);
-
-
-}
-
-Exadel.Menu.Layer.ClickInput = function(event){
- //alert("event rabotaet dsds ");
- Event.stop(event || window.event);
- return false;
-}
-
-Exadel.Menu.Layer.MouseoutInInput = function(event){
- var ClickInput = Exadel.Menu.Layer.ClickInput.bindAsEventListener(this);
- Event.stopObserving(Event.element(event), "click", Exadel.Menu.Layer.ClickInput);
-
-}
-
-
Exadel.Menu.Layer.prototype = {
initialize: function(id,delay, hideDelay){
Exadel.Menu.Layers.listl.push(id);
@@ -637,84 +576,154 @@
this.layer = $(id);
this.level = 0;
this.delay = delay;
+ if (hideDelay){
+ this.hideDelay=hideDelay;
+ }
+ else{
+ this.hideDelay=hideDelay;
+ }
Exadel.Menu.fitLayerToContent(this.layer);
this.items = new Array();
Exadel.Menu.Layers.layers[id] = this;
this.bindings = new Array();
+
+
+ this.mouseover =
+ function(e){
+ Exadel.Menu.MouseIn=true;
+ Exadel.Menu.Layers.clearLMTO();
+ Event.stop(e);
+ }.bindAsEventListener(this);
+
+ this.mouseout =
+ function(e){
+ Exadel.Menu.MouseIn = false;
+ if (!Exadel.Menu.selectOpen) {
+ Exadel.Menu.Layers.setLMTO(this.hideDelay);
+ }
+ Event.stop(e);
+ }.bindAsEventListener(this);
+
+
+
var binding = new Exadel.Menu.Layer.Binding (
this.id,
"mouseover",
- Exadel.Menu.Layer.mouseover);
+ this.mouseover);
this.bindings.push(binding);
binding.refresh();
binding = new Exadel.Menu.Layer.Binding (
this.id,
"mouseout",
- Exadel.Menu.Layer.mouseout);
+ this.mouseout);
this.bindings.push(binding);
binding.refresh();
- $A(this.layer.getElementsByTagName("select"))
- .each(
- function(select) {
- Event.observe(select, "focus", Exadel.Menu.Layer.openSelect);
- Event.observe(select, "blur", Exadel.Menu.Layer.closeSelect);
-
- var MouseoverInInput = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
- var MouseoutInInput = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- Event.observe(select, "mouseover", MouseoverInInput);
- Event.observe(select, "mouseout", MouseoutInInput);
+ arrayinp=$A(this.layer.getElementsByTagName("select"));
+ for(i=0; i<arrayinp.length; i++){
+ var openSelectb = this.openSelect.bindAsEventListener(this);
+ var closeSelectb = this.closeSelect.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "focus", openSelectb);
+ Event.observe(arrayinp[i], "blur", closeSelectb);
+ //var MouseoverInInputb = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
+ //var MouseoutInInputb = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
+ Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
- var OnKeyPress = Exadel.Menu.Layer.OnKeyPress.bindAsEventListener(this);
- Event.observe(select, "keypress", OnKeyPress);
-
- }
- );
+ //var OnKeyPressb = Exadel.Menu.Layer.OnKeyPress.bindAsEventListener(this);
+ var OnKeyPressb = this.OnKeyPress.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "keypress", OnKeyPressb);
+ }
- $A(this.layer.getElementsByTagName("input"))
- .each(
- function(input) {
- //alert("add event");
- Event.observe(input, "focus", Exadel.Menu.Layer.openSelect);
- Event.observe(input, "blur", Exadel.Menu.Layer.closeSelect);
-
-
- var MouseoverInInput = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
- var MouseoutInInput = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- Event.observe(input, "mouseover", MouseoverInInput);
- Event.observe(input, "mouseout", MouseoutInInput);
-
- var OnKeyPress = Exadel.Menu.Layer.OnKeyPress.bindAsEventListener(this);
- Event.observe(input, "keypress", OnKeyPress);
-
- }
- );
-
+ arrayinp=$A(this.layer.getElementsByTagName("input"));
+ for(i=0; i<arrayinp.length; i++){
+ var openSelectb = this.openSelect.bindAsEventListener(this);
+ var closeSelectb = this.closeSelect.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "focus", openSelectb);
+ Event.observe(arrayinp[i], "blur", closeSelectb);
+ //var MouseoverInInputb = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
+ //var MouseoutInInputb = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
+ Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
+ var OnKeyPressb = this.OnKeyPress.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "keypress", OnKeyPressb);
+ }
- $A(this.layer.getElementsByTagName("textarea"))
- .each(
- function(textarea) {
- Event.observe(textarea, "focus", Exadel.Menu.Layer.openSelect);
- Event.observe(textarea, "blur", Exadel.Menu.Layer.closeSelect);
-
- var MouseoverInInput = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
- var MouseoutInInput = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- Event.observe(textarea, "mouseover", MouseoverInInput);
- Event.observe(textarea, "mouseout", MouseoutInInput);
- }
- );
+ arrayinp=$A(this.layer.getElementsByTagName("textarea"));
+ for(i=0; i<arrayinp.length; i++){
+ var openSelectb = this.openSelect.bindAsEventListener(this);
+ var closeSelectb = this.closeSelect.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "focus", openSelectb);
+ Event.observe(arrayinp[i], "blur", closeSelectb);
+ //var MouseoverInInputb = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
+ //var MouseoutInInputb = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
+ Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
+ }
-
-
-
-
if(window.A4J && A4J.AJAX ){
var listener = new A4J.AJAX.Listener(this.rebind.bindAsEventListener(this));
A4J.AJAX.AddListener(listener);
}
},
+
+
+
+ openSelect: function(event){
+ Exadel.Menu.selectOpen = true;
+ var ClickInputb = this.ClickInput.bindAsEventListener(this);
+ Event.observe(Event.element(event), "click", this.ClickInput);
+
+ },
+
+
+ closeSelect: function(event){
+ Exadel.Menu.selectOpen = false;
+ var ClickInputb = this.ClickInput.bindAsEventListener(this);
+ Event.stopObserving(Event.element(event), "click", this.ClickInput);
+ if (Exadel.Menu.MouseIn == false){
+ Exadel.Menu.Layers.setLMTO(this.hideDelay);
+ }
+ },
+
+
+
+ OnKeyPress: function(event){
+
+ if(event.keyCode==13){
+ Exadel.Menu.Layers.setLMTO(this.hideDelay);
+ }
+ },
+
+
+ MouseoverInInput: function(event){
+ //alert("event rabotaet "+ event.target);
+ var ClickInputb = this.ClickInput.bindAsEventListener(this);
+ Event.observe(Event.element(event), "click", this.ClickInput);
+ },
+
+
+ ClickInput: function(event){
+ //alert("event rabotaet dsds ");
+ Event.stop(event || window.event);
+ return false;
+ },
+
+
+ MouseoutInInput: function(event){
+ var ClickInputb = this.ClickInput.bindAsEventListener(this);
+ Event.stopObserving(Event.element(event), "click", this.ClickInput);
+
+ },
+
rebind:function(){
$A(this.bindings)
.each(
@@ -864,7 +873,7 @@
var dis = this;
var onmouseout =
function(e){
- Exadel.Menu.Layers.setLMTO();
+ Exadel.Menu.Layers.setLMTO(this.hideDelay);
Exadel.Menu.Layers.clearPopUpTO();
}.bindAsEventListener(this);
@@ -880,7 +889,8 @@
// }
return this;
},
- asSubMenu: function(parent, refLayerName, evtName, options){
+
+ asSubMenu: function(parentv, refLayerName, evtName, options){
this.options = options || {};
if (this.options.onclose != ""){
this.eventOnClose = new Function("event",this.options.onclose).bindAsEventListener(this);
@@ -893,17 +903,29 @@
evtName = 'onmouseover';
}
evtName = this.eventJsToPrototype(evtName);
- this.level = Exadel.Menu.Layers.layers[parent].level + 1;
- Exadel.Menu.Layers.father[this.id] = parent;
+ this.level = Exadel.Menu.Layers.layers[parentv].level + 1;
+ Exadel.Menu.Layers.father[this.id] = parentv;
if(!refLayerName){
- refLayerName = 'ref' + parent;
+ refLayerName = 'ref' + parentv;
}
var refLayer = $(refLayerName);
- this.refItem = Exadel.Menu.Layers.layers[parent].items[refLayerName];
+ this.refItem = Exadel.Menu.Layers.layers[parentv].items[refLayerName];
this.refItem.childMenu = this;
var binding = new Exadel.Menu.Layer.Binding(refLayerName, evtName, this.showMe.bindAsEventListener(this));
this.bindings.push(binding);
binding.refresh();
+
+
+ // set parents hideDelay
+ var menuLayer=this;
+ while (menuLayer.level > 0) {
+ menuLayer = Exadel.Menu.Layers.layers[(Exadel.Menu.Layers.father[menuLayer.id])];
+ }
+ if (menuLayer && menuLayer.hideDelay){
+ this.hideDelay=menuLayer.hideDelay;
+ }
+
+
return this;
},
asContextMenu: function(parent, evt){
@@ -919,7 +941,7 @@
var dis = this;
var onmouseout =
function(e){
- Exadel.Menu.Layers.setLMTO();
+ Exadel.Menu.Layers.setLMTO(this.hideDelay);
Exadel.Menu.Layers.clearPopUpTO();
}.bindAsEventListener(this);
evt = this.eventJsToPrototype(evt);
19 years
JBoss Rich Faces SVN: r279 - trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-04-05 05:24:16 -0400 (Thu, 05 Apr 2007)
New Revision: 279
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-05 09:23:20 UTC (rev 278)
+++ trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2007-04-05 09:24:16 UTC (rev 279)
@@ -98,6 +98,20 @@
}
/**
+ * Test component default values
+ *
+ * @throws Exception
+ */
+ public void testDefaultValues() throws Exception {
+ assertEquals("200", sb.getWidth());
+ assertEquals("200", sb.getHeight());
+ assertEquals(true, sb.isAjaxSingle());
+ assertEquals("richfaces_suggestionEntry", sb.getEntryClass());
+ assertEquals("richfaces_suggestionSelectValue", sb.getSelectValueClass());
+ assertEquals("richfaces_suggestionSelectValue", sb.getSelectValueClass());
+ assertEquals("inputvalue", sb.getParam());
+ }
+ /**
* Test component rendering
*
* @throws Exception
19 years