JBoss Rich Faces SVN: r10589 - trunk/ui/inplaceInput/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-29 04:25:19 -0400 (Mon, 29 Sep 2008)
New Revision: 10589
Modified:
trunk/ui/inplaceInput/src/test/java/org/richfaces/component/InplaceInputComponentTest.java
Log:
fix test
Modified: trunk/ui/inplaceInput/src/test/java/org/richfaces/component/InplaceInputComponentTest.java
===================================================================
--- trunk/ui/inplaceInput/src/test/java/org/richfaces/component/InplaceInputComponentTest.java 2008-09-29 08:24:54 UTC (rev 10588)
+++ trunk/ui/inplaceInput/src/test/java/org/richfaces/component/InplaceInputComponentTest.java 2008-09-29 08:25:19 UTC (rev 10589)
@@ -26,6 +26,7 @@
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
javaScripts.add("scripts/inplaceinput.js");
+ javaScripts.add("scripts/inplaceinputstyles.js");
javaScripts.add("scripts/utils.js");
javaScripts.add("scripts/comboboxUtils.js");
16 years, 2 months
JBoss Rich Faces SVN: r10588 - trunk/ui/combobox/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-29 04:24:54 -0400 (Mon, 29 Sep 2008)
New Revision: 10588
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
Log:
fix test
Modified: trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-09-26 23:54:31 UTC (rev 10587)
+++ trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-09-29 08:24:54 UTC (rev 10588)
@@ -56,6 +56,7 @@
javaScripts.add("org/richfaces/renderkit/html/scripts/jquery/jquery.js");
javaScripts.add("scripts/comboboxUtils.js");
javaScripts.add("scripts/combobox.js");
+ javaScripts.add("scripts/comboboxstyles.js");
javaScripts.add("scripts/combolist.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
@@ -131,13 +132,6 @@
for (Iterator it = scripts.iterator(); it.hasNext();) {
HtmlScript item = (HtmlScript) it.next();
String srcAttr = item.getSrcAttribute();
- if (item.getFirstChild() != null) {
- String scriptBodyString = item.getFirstChild().toString();
- if (scriptBodyString.contains("Richfaces.ComboBox")) {
- assertTrue(scriptBodyString.contains("Richfaces.ComboBox.CLASSES"));
- }
- }
-
if (StringUtils.isNotBlank(srcAttr)) {
boolean found = false;
for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
16 years, 2 months
JBoss Rich Faces SVN: r10587 - in branches/jsf2.0/framework: api and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-09-26 19:54:31 -0400 (Fri, 26 Sep 2008)
New Revision: 10587
Modified:
branches/jsf2.0/framework/api/pom.xml
branches/jsf2.0/framework/impl/pom.xml
branches/jsf2.0/framework/pom.xml
branches/jsf2.0/framework/test/pom.xml
Log:
Switch dependencies to Mojarra 2.0.0-SNAPSHOT
Modified: branches/jsf2.0/framework/api/pom.xml
===================================================================
--- branches/jsf2.0/framework/api/pom.xml 2008-09-26 15:10:23 UTC (rev 10586)
+++ branches/jsf2.0/framework/api/pom.xml 2008-09-26 23:54:31 UTC (rev 10587)
@@ -2,13 +2,13 @@
<parent>
<artifactId>framework</artifactId>
<groupId>org.richfaces</groupId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
<name>Java Server Faces AJAX framework API</name>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>commons-collections</groupId>
Modified: branches/jsf2.0/framework/impl/pom.xml
===================================================================
--- branches/jsf2.0/framework/impl/pom.xml 2008-09-26 15:10:23 UTC (rev 10586)
+++ branches/jsf2.0/framework/impl/pom.xml 2008-09-26 23:54:31 UTC (rev 10587)
@@ -3,13 +3,13 @@
<parent>
<artifactId>framework</artifactId>
<groupId>org.richfaces</groupId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
<name>Java Server Faces AJAX framework implementation</name>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<build>
<resources>
<resource>
@@ -160,7 +160,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/jsf2.0/framework/pom.xml
===================================================================
--- branches/jsf2.0/framework/pom.xml 2008-09-26 15:10:23 UTC (rev 10586)
+++ branches/jsf2.0/framework/pom.xml 2008-09-26 23:54:31 UTC (rev 10587)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>root</artifactId>
<groupId>org.richfaces</groupId>
@@ -7,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
<artifactId>framework</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Java Server Faces AJAX framework</name>
<build>
@@ -90,19 +91,18 @@
<version>2.1</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>jstl</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
- <groupId>jstl</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- <scope>provided</scope>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>mojarra-jsf-api</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_09</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
@@ -112,8 +112,7 @@
</dependencies>
<modules>
<!--
- <module>api-parent</module>
- <module>impl-parent</module>
+ <module>api-parent</module> <module>impl-parent</module>
-->
<module>api</module>
<module>impl</module>
Modified: branches/jsf2.0/framework/test/pom.xml
===================================================================
--- branches/jsf2.0/framework/test/pom.xml 2008-09-26 15:10:23 UTC (rev 10586)
+++ branches/jsf2.0/framework/test/pom.xml 2008-09-26 23:54:31 UTC (rev 10587)
@@ -2,12 +2,12 @@
<parent>
<artifactId>framework</artifactId>
<groupId>org.richfaces</groupId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-test</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>Ajax4Jsf test framework</name>
<url>https://ajax4jsf.dev.java.net</url>
<dependencies>
@@ -42,12 +42,12 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_09</version>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>mojarra-jsf-impl</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
16 years, 3 months
JBoss Rich Faces SVN: r10586 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-26 11:10:23 -0400 (Fri, 26 Sep 2008)
New Revision: 10586
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js
Log:
remove junk css classes
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js 2008-09-26 15:05:19 UTC (rev 10585)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js 2008-09-26 15:10:23 UTC (rev 10586)
@@ -3,15 +3,15 @@
Richfaces.ComboBox.classes = {
button : { classes : {
- normal : "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive #{buttonInactiveClass}",
- active : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}",
- disabled : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled #{buttonDisabledClass}",
+ normal : "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive",
+ active : "rich-combobox-font rich-combobox-button-icon rich-combobox-button",
+ disabled : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled",
hovered : "rich-combobox-button-hovered"},
style : {
- normal: "#{buttonInactiveStyle}",
- active: "#{buttonStyle}",
- disabled: "#{buttonDisabledStyle}"}
+ normal: "",
+ active: "",
+ disabled: ""}
},
buttonbg : {
@@ -22,34 +22,34 @@
},
buttonicon : {style : {
- normal: "#{buttonIconInactive}",
- active: "#{buttonIcon}",
- disabled: "#{buttonIconDisabled}"}
+ normal: "",
+ active: "",
+ disabled: ""}
},
field : {classes: {
- normal : "rich-combobox-font-inactive rich-combobox-input-inactive #{inputInactiveClass}",
- active : "rich-combobox-font rich-combobox-input #{inputClass}",
- disabled : "rich-combobox-font-disabled rich-combobox-input-disabled #{inputDisabledClass}"
+ normal : "rich-combobox-font-inactive rich-combobox-input-inactive",
+ active : "rich-combobox-font rich-combobox-input",
+ disabled : "rich-combobox-font-disabled rich-combobox-input-disabled"
},
style : {
- normal : "#{inputInactiveStyle}",
- active : "#{inputStyle}",
- disabled : "#{inputDisabledStyle}"
+ normal : "",
+ active : "",
+ disabled : ""
}
},
combolist : {
list : {
classes :{
- active : "rich-combobox-list-cord rich-combobox-list-scroll rich-combobox-list-decoration rich-combobox-list-position #{listClass}"},
- style : {active: "#{listStyle}"
+ active : "rich-combobox-list-cord rich-combobox-list-scroll rich-combobox-list-decoration rich-combobox-list-position"},
+ style : {active: ""
}
},
- item : {normal : "rich-combobox-item #{itemClass}",
- selected : "rich-combobox-item rich-combobox-item-selected #{itemSelectedClass}"
+ item : {normal : "rich-combobox-item",
+ selected : "rich-combobox-item rich-combobox-item-selected"
}
}
}
\ No newline at end of file
16 years, 3 months
JBoss Rich Faces SVN: r10585 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-26 11:05:19 -0400 (Fri, 26 Sep 2008)
New Revision: 10585
Added:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js
Log:
https://jira.jboss.org/jira/browse/RF-4280
Added: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js (rev 0)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js 2008-09-26 15:05:19 UTC (rev 10585)
@@ -0,0 +1,55 @@
+if (!window.Richfaces) window.Richfaces = {};
+if (!Richfaces.ComboBox) Richfaces.ComboBox = {};
+
+Richfaces.ComboBox.classes = {
+ button : { classes : {
+ normal : "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive #{buttonInactiveClass}",
+ active : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}",
+ disabled : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled #{buttonDisabledClass}",
+ hovered : "rich-combobox-button-hovered"},
+
+ style : {
+ normal: "#{buttonInactiveStyle}",
+ active: "#{buttonStyle}",
+ disabled: "#{buttonDisabledStyle}"}
+ },
+
+ buttonbg : {
+ classes : {
+ normal:"rich-combobox-font-inactive rich-combobox-button-background-inactive rich-combobox-button-inactive",
+ active: "rich-combobox-font rich-combobox-button-background rich-combobox-button",
+ disabled : "rich-combobox-font-disabled rich-combobox-button-background-disabled rich-combobox-button-disabled"}
+ },
+
+ buttonicon : {style : {
+ normal: "#{buttonIconInactive}",
+ active: "#{buttonIcon}",
+ disabled: "#{buttonIconDisabled}"}
+ },
+
+ field : {classes: {
+ normal : "rich-combobox-font-inactive rich-combobox-input-inactive #{inputInactiveClass}",
+ active : "rich-combobox-font rich-combobox-input #{inputClass}",
+ disabled : "rich-combobox-font-disabled rich-combobox-input-disabled #{inputDisabledClass}"
+ },
+
+ style : {
+ normal : "#{inputInactiveStyle}",
+ active : "#{inputStyle}",
+ disabled : "#{inputDisabledStyle}"
+ }
+ },
+
+ combolist : {
+ list : {
+ classes :{
+ active : "rich-combobox-list-cord rich-combobox-list-scroll rich-combobox-list-decoration rich-combobox-list-position #{listClass}"},
+ style : {active: "#{listStyle}"
+ }
+ },
+
+ item : {normal : "rich-combobox-item #{itemClass}",
+ selected : "rich-combobox-item rich-combobox-item-selected #{itemSelectedClass}"
+ }
+ }
+}
\ No newline at end of file
16 years, 3 months
JBoss Rich Faces SVN: r10584 - trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-26 11:04:43 -0400 (Fri, 26 Sep 2008)
New Revision: 10584
Added:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinputstyles.js
Log:
https://jira.jboss.org/jira/browse/RF-4280
Added: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinputstyles.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinputstyles.js (rev 0)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinputstyles.js 2008-09-26 15:04:43 UTC (rev 10584)
@@ -0,0 +1,24 @@
+if (!window.Richfaces) window.Richfaces = {};
+
+if (!Richfaces.InplaceInput) Richfaces.inplaceInput = {};
+
+Richfaces.InplaceInput.classes = {
+
+ component:{
+ view :{
+ normal:"rich-inplace rich-inplace-view",
+ hovered:"rich-inplace-input-view-hover"
+ },
+ changed:{
+ normal:"rich-inplace rich-inplace-changed",
+ hovered:"rich-inplace-input-changed-hover"
+ },
+ editable:"rich-inplace rich-inplace-edit editClass"
+ }
+};
+
+
+
+
+
+
16 years, 3 months
JBoss Rich Faces SVN: r10583 - trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-26 11:04:08 -0400 (Fri, 26 Sep 2008)
New Revision: 10583
Added:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectstyles.js
Log:
https://jira.jboss.org/jira/browse/RF-4280
Added: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectstyles.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectstyles.js (rev 0)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectstyles.js 2008-09-26 15:04:08 UTC (rev 10583)
@@ -0,0 +1,24 @@
+if (!window.Richfaces) window.Richfaces = {};
+
+if (!Richfaces.InplaceSelect) Richfaces.inplaceSelect = {};
+
+Richfaces.InplaceSelect.classes = {
+
+ combolist : {
+ list :{
+ classes :{
+ active : "rich-inplace-select-list-scroll rich-inplace-select-list-decoration rich-inplace-select-list-position"
+ }
+ },
+ item : {
+ normal : "rich-inplace-select-item rich-inplace-select-font",
+ selected : 'rich-inplace-select-item rich-inplace-select-font rich-inplace-select-selected-item'
+ }
+ },
+ component : {
+ changed : {normal : 'rich-inplace-select rich-inplace-select-view rich-inplace-select-changed', hovered : 'rich-inplace-select-changed-hover'},
+ view : {normal : 'rich-inplace-select rich-inplace-select-view', hovered : 'rich-inplace-select-view-hover'},
+ editable : 'rich-inplace-select rich-inplace-select-view rich-inplace-select-edit'
+ }
+};
+
\ No newline at end of file
16 years, 3 months
JBoss Rich Faces SVN: r10582 - in trunk/ui/inplaceSelect/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-26 11:03:34 -0400 (Fri, 26 Sep 2008)
New Revision: 10582
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4280
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-09-26 15:03:07 UTC (rev 10581)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-09-26 15:03:34 UTC (rev 10582)
@@ -1,9 +1,9 @@
if(!window.Richfaces) window.Richfaces = {};
Richfaces.InplaceSelect = Class.create(Richfaces.InplaceInput, {
- initialize : function($super, listObj, clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, classes, barParams, buttonId) {
+ initialize : function($super, listObj, clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, userStyles, commonStyles, barParams, buttonId) {
this.button = $(buttonId);
this.comboList = listObj;
- $super(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, classes, barParams);
+ $super(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, userStyles, commonStyles, barParams);
this.clickOnBar = false;
this.inplaceSelect = $(clientId);
this.inplaceSelect.component = this;
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-09-26 15:03:07 UTC (rev 10581)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-09-26 15:03:34 UTC (rev 10582)
@@ -1,7 +1,8 @@
if(!window.Richfaces) window.Richfaces = {};
Richfaces.InplaceSelectList = Class.create(Richfaces.ComboBoxList, {
- initialize : function($super, listId, parentListId, selectFirstOnUpdate, classes, width, height, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay, value) {
- $super(listId, parentListId, selectFirstOnUpdate, null, classes, width, height, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay);
+ initialize : function($super, listId, parentListId, selectFirstOnUpdate, userStyles, commonStyles, width, height, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay, value) {
+ this.classes = Richfaces.mergeStyles(userStyles, commonStyles);
+ $super(listId, parentListId, selectFirstOnUpdate, null, this.classes, width, height, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay);
this.wrappingItems(value);
this.isListOpened = false;
},
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-09-26 15:03:07 UTC (rev 10581)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-09-26 15:03:34 UTC (rev 10582)
@@ -15,13 +15,14 @@
<h:styles>css/inplaceselect.xcss</h:styles>
<h:scripts>
- new org.ajax4jsf.javascript.PrototypeScript(),
+ new org.ajax4jsf.javascript.PrototypeScript() ,
/org/richfaces/renderkit/html/scripts/jquery/jquery.js,
- scripts/comboboxUtils.js,
- scripts/combolist.js,
- scripts/inplaceinput.js,
+ scripts/comboboxUtils.js ,
+ scripts/combolist.js ,
+ scripts/inplaceinput.js ,
scripts/inplaceselectlist.js,
scripts/inplaceselect.js,
+ scripts/inplaceselectstyles.js,
/org/richfaces/renderkit/html/scripts/utils.js
</h:scripts>
@@ -200,43 +201,44 @@
</div>
</div>
<script type="text/javascript">
- Richfaces.InplaceSelect.CLASSES = {
- COMBO_LIST : {
- LIST : {CLASSES :{ACTIVE : "rich-inplace-select-list-scroll rich-inplace-select-list-decoration rich-inplace-select-list-position #{listClass}"
- }
- },
- ITEM : {NORMAL : "rich-inplace-select-item rich-inplace-select-font #{itemClass}",
- SELECTED : 'rich-inplace-select-item rich-inplace-select-font rich-inplace-select-selected-item #{itemSelectedClass}'
- }
- },
- COMPONENT : {CHANGED : {NORMAL : 'rich-inplace-select rich-inplace-select-view rich-inplace-select-changed #{component.attributes["changedClass"]}', HOVERED : 'rich-inplace-select-changed-hover #{component.attributes["changedHoverClass"]}'},
- VIEW : {NORMAL : 'rich-inplace-select rich-inplace-select-view #{component.attributes["viewClass"]}', HOVERED : 'rich-inplace-select-view-hover #{component.attributes["viewHoverClass"]}'},
- EDITABLE : 'rich-inplace-select rich-inplace-select-view rich-inplace-select-edit #{component.attributes["editClass"]}'
- }
+
+
+ var inplaceSelectUserStyles = {
+
+ combolist: {
+ list: { classes: {active:'#{listClass}'}},
+ item: { normal:'#{itemClass}', selected:'#{itemSelectedClass}'}
+ },
+
+ component: {
+ changed :{normal:'#{component.attributes["changedClass"]}',hovered:'#{component.attributes["changedHoverClass"]}'},
+ view : {normal:'#{component.attributes["viewClass"]}',hovered:'#{component.attributes["viewHoverClass"]}'},
+ editable:'#{component.attributes["editClass"]}'
+ }
};
- new Richfaces.InplaceSelect(new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
- Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component,items)}, null,
- '#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0, #{encodedFieldValue}),
- '#{clientId}', '#{clientId}inplaceTmpValue',
- '#{clientId}inplaceValue', '#{clientId}tabber',
- {defaultLabel : '#{component.attributes["defaultLabel"]}',
- showControls : #{component.attributes["showControls"]},
- editEvent : '#{component.attributes["editEvent"]}',
- verticalPosition : '#{component.attributes["controlsVerticalPosition"]}',
- horizontalPosition : '#{component.attributes["controlsHorizontalPosition"]}',
- inputWidth : '#{component.attributes["selectWidth"]}',
- minInputWidth : '#{component.attributes["minSelectWidth"]}',
- maxInputWidth : '#{component.attributes["maxSelectWidth"]}',
- openOnEdit: #{component.attributes["openOnEdit"]},
- closeOnSelect: true},
- {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
- onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
- oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
- onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")},
- onchange : #{this:getAsEventHandler(context, component, "onchange")}},
- Richfaces.InplaceSelect.CLASSES,
- ['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons', '#{clientId}btns_shadow'], '#{clientId}inselArrow');
+ new Richfaces.InplaceSelect(new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
+ inplaceSelectUserStyles.combolist, Richfaces.InplaceSelect.classes.combolist, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component,items)}, null,
+ '#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0, #{encodedFieldValue}),
+ '#{clientId}', '#{clientId}inplaceTmpValue',
+ '#{clientId}inplaceValue', '#{clientId}tabber',
+ {defaultLabel : '#{component.attributes["defaultLabel"]}',
+ showControls : #{component.attributes["showControls"]},
+ editEvent : '#{component.attributes["editEvent"]}',
+ verticalPosition : '#{component.attributes["controlsVerticalPosition"]}',
+ horizontalPosition : '#{component.attributes["controlsHorizontalPosition"]}',
+ inputWidth : '#{component.attributes["selectWidth"]}',
+ minInputWidth : '#{component.attributes["minSelectWidth"]}',
+ maxInputWidth : '#{component.attributes["maxSelectWidth"]}',
+ openOnEdit: #{component.attributes["openOnEdit"]},
+ closeOnSelect: true},
+ {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
+ onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
+ oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
+ onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")},
+ onchange : #{this:getAsEventHandler(context, component, "onchange")}},
+ inplaceSelectUserStyles, Richfaces.InplaceSelect.classes,
+ ['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons', '#{clientId}btns_shadow'], '#{clientId}inselArrow');
</script>
</div>
16 years, 3 months
JBoss Rich Faces SVN: r10581 - in trunk/ui/inplaceInput/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-26 11:03:07 -0400 (Fri, 26 Sep 2008)
New Revision: 10581
Modified:
trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4280
Modified: trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-09-26 15:02:46 UTC (rev 10580)
+++ trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-09-26 15:03:07 UTC (rev 10581)
@@ -27,71 +27,10 @@
private static Log logger = LogFactory.getLog(InplaceInputBaseRenderer.class);
private static final String CONTROLS_FACET = "controls";
-
- private static final String INPLACE_COMPONENT = "COMPONENT";
-
- private static final String INPLACE_CHANGED = "CHANGED";
-
- private static final String INPLACE_VIEW = "VIEW";
-
- private static final String INPLACE_EDITABLE = "EDITABLE";
-
- private static final String INPLACE_NORMAL = "NORMAL";
-
- private static final String INPLACE_HOVERED = "HOVERED";
-
- private static final String INPLACE_CSS_PUBLIC = "rich-inplace";
-
- private static final String INPLACE_CSS_VIEW = "view";
-
- private static final String INPLACE_CSS_EDITABLE = "edit";
-
- private static final String INPLACE_CSS_CHANGE = "changed";
-
- private static final String INPLACE_CSS_HOVER = "hover";
-
+
private static final String EMPTY_DEFAULT_LABEL = "\u00a0\u00a0\u00a0";
- private static enum States {
- NORMAL {String createCss(UIComponent component, String suffix){
- StringBuilder builder = new StringBuilder();
- builder.append(INPLACE_CSS_PUBLIC);
- builder.append(" ");
- builder.append(INPLACE_CSS_PUBLIC + "-" + suffix);
- Object value = component.getAttributes().get(suffix + "Class");
- if (value != null) {
- builder.append(" ");
- builder.append(value);
- }
- return builder.toString();
- };},
- HOVERED {String createCss(UIComponent component , String suffix){
- StringBuilder builder = new StringBuilder();
- builder.append(INPLACE_CSS_PUBLIC + "-" + "input-" + suffix + "-" + INPLACE_CSS_HOVER);
- Object value = component.getAttributes().get(suffix + "HoverClass");
- if (value != null) {
- builder.append(" ");
- builder.append(value);
- }
- return builder.toString();
- }},
- EDIT {String createCss(UIComponent component, String suffix){
- StringBuilder builder = new StringBuilder();
- builder.append(INPLACE_CSS_PUBLIC);
- builder.append(" ");
- builder.append(INPLACE_CSS_PUBLIC + "-" + suffix);
- Object value = component.getAttributes().get(suffix + "Class");
- if (value != null) {
- builder.append(" ");
- builder.append(value);
- }
- return builder.toString();
- }};
- abstract String createCss(UIComponent component, String suffix);
- };
-
-
-
+
protected Class<? extends UIComponent> getComponentClass() {
return UIInplaceInput.class;
}
@@ -190,34 +129,6 @@
return events.toString();
}
- public String encodeInplaceInputCss(FacesContext context, UIComponent component) {
- StringBuilder cssMap = new StringBuilder();
- cssMap.append("var classes = ");
-
- ScriptOptions mainMap = new ScriptOptions(component);
- ScriptOptions componentClasses = new ScriptOptions(component);
- ScriptOptions changedClasses = new ScriptOptions(component);
- ScriptOptions viewClasses = new ScriptOptions(component);
-
- changedClasses.addOption(INPLACE_NORMAL, createCss(component, States.NORMAL, INPLACE_CSS_CHANGE) );
- changedClasses.addOption(INPLACE_HOVERED, createCss(component,States.HOVERED, INPLACE_CSS_CHANGE));
-
- viewClasses.addOption(INPLACE_NORMAL, createCss(component, States.NORMAL, INPLACE_CSS_VIEW) );;
- viewClasses.addOption(INPLACE_HOVERED, createCss(component,States.HOVERED, INPLACE_CSS_VIEW));
-
- componentClasses.addOption(INPLACE_CHANGED,changedClasses);
- componentClasses.addOption(INPLACE_VIEW, viewClasses);
- componentClasses.addOption(INPLACE_EDITABLE,createCss(component, States.EDIT, INPLACE_CSS_EDITABLE));
-
- mainMap.addOption(INPLACE_COMPONENT, componentClasses);
- cssMap.append(mainMap.toString());
- return cssMap.toString();
- }
-
- private String createCss(UIComponent component, States state, String suffix) {
- return state.createCss(component, suffix);
- }
-
public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
JSFunctionDefinition script = getUtils().getAsEventHandler(context, component, attributeName, null);
return ScriptUtils.toScript(script);
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-09-26 15:02:46 UTC (rev 10580)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-09-26 15:03:07 UTC (rev 10581)
@@ -4,7 +4,7 @@
Richfaces.InplaceInput.prototype = {
//TODO: remove $$$$$
- initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, classes, barParams) {
+ initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, userStyles, commonStyles, barParams) {
//TODO: delete tabberId from parameters
this.inplaceInput = $(clientId);
this.inplaceInput.component = this;
@@ -13,8 +13,7 @@
this.valueKeeper = $(valueKeepId);
this.attributes = attributes;
this.events = events;
-
- this.classes = classes;
+
//TODO: static methods are preferred to be called within constructor
this.currentText = this.getCurrentText();
this.value = this.valueKeeper.value;
@@ -35,6 +34,7 @@
this.initHandlers();
this.initEvents();
+ this.classes = Richfaces.mergeStyles(userStyles,commonStyles);
this["rich:destructor"] = "destroy";
this.skipSwitching = false;
@@ -81,12 +81,12 @@
//TODO: Nick recommends regexp
var className = this.inplaceInput.className;
if (this.currentState == Richfaces.InplaceInput.STATES[0]) {
- if (className.indexOf(this.classes.COMPONENT.VIEW.HOVERED) == -1) {
- className += " " + this.classes.COMPONENT.VIEW.HOVERED;
+ if (className.indexOf(this.classes.component.view.hovered) == -1) {
+ className += " " + this.classes.component.view.hovered;
}
} else if (this.currentState == Richfaces.InplaceInput.STATES[2]) {
- if (className.indexOf(this.classes.COMPONENT.CHANGED.HOVERED) == -1) {
- className += " " + this.classes.COMPONENT.CHANGED.HOVERED;
+ if (className.indexOf(this.classes.component.changed.hovered) == -1) {
+ className += " " + this.classes.component.changed.hovered;
}
}
this.inplaceInput.className = className;
@@ -94,9 +94,9 @@
inplaceMouseOutHandler : function(e) {
if (this.currentState == Richfaces.InplaceInput.STATES[0]) {
- this.inplaceInput.className = this.classes.COMPONENT.VIEW.NORMAL;
+ this.inplaceInput.className = this.classes.component.view.normal;
} else if (this.currentState == Richfaces.InplaceInput.STATES[2]) {
- this.inplaceInput.className = this.classes.COMPONENT.CHANGED.NORMAL;
+ this.inplaceInput.className = this.classes.component.changed.normal;
}
},
@@ -204,7 +204,7 @@
var inputSize = this.setInputWidth(textWidth);
this.tempValueKeeper.style.clip = 'rect(auto auto auto auto)';
- this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
+ this.inplaceInput.className = this.classes.component.editable;
if (this.bar) {
this.bar.show(inputSize, this.tempValueKeeper.offsetHeight);
@@ -221,7 +221,7 @@
this.changeState(Richfaces.InplaceInput.STATES[0]);
this.createNewText(this.currentText);
- this.inplaceInput.className = this.classes.COMPONENT.VIEW.NORMAL;
+ this.inplaceInput.className = this.classes.component.view.normal;
//TODO: see above
this.inplaceInput.observe("mouseover", function(e){this.inplaceMouseOverHandler(e);}.bindAsEventListener(this));
},
@@ -232,7 +232,7 @@
this.changeState(Richfaces.InplaceInput.STATES[2]);
this.createNewText(this.currentText);
- this.inplaceInput.className = this.classes.COMPONENT.CHANGED.NORMAL;
+ this.inplaceInput.className = this.classes.component.changed.normal;
},
/**
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-09-26 15:02:46 UTC (rev 10580)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-09-26 15:03:07 UTC (rev 10581)
@@ -16,6 +16,7 @@
new org.ajax4jsf.javascript.PrototypeScript(),
scripts/comboboxUtils.js,
scripts/inplaceinput.js,
+ scripts/inplaceinputstyles.js,
scripts/utils.js
</h:scripts>
<f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.SaveControlIcon"/>
@@ -164,10 +165,24 @@
#{this:encodeScriptAttributes(context, component)};
#{this:encodeScriptEvents(context, component)};
- #{this:encodeInplaceInputCss(context, component)};
+
+ var inplaceInputUserStyles = {
+ component:{
+ view :{
+ normal:'#{component.attributes["viewClass"]}',
+ hovered:'#{component.attributes["viewHoverClass"]}'
+ },
+ changed:{
+ normal:'#{component.attributes["changedClass"]}',
+ hovered:'#{component.attributes["changedHoverClass"]}',
+ },
+ editable:'#{component.attributes["editClass"]}'
+
+ }
+ };
var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', '#{clientId}tabber',
- attributes, events, classes, ['#{clientId}bar',
+ attributes, events, inplaceInputUserStyles, Richfaces.InplaceInput.classes, ['#{clientId}bar',
'#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons','#{clientId}btns_shadow']);
</script>
</div>
16 years, 3 months
JBoss Rich Faces SVN: r10580 - in trunk/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-09-26 11:02:46 -0400 (Fri, 26 Sep 2008)
New Revision: 10580
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
trunk/ui/combobox/src/main/templates/combobox.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4280
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-09-26 15:02:22 UTC (rev 10579)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-09-26 15:02:46 UTC (rev 10580)
@@ -4,19 +4,20 @@
Richfaces.ComboBox.prototype = {
- initialize: function(combobox, listId, parentListId, valueFieldId, fieldId, buttonId, buttonBGId, shadowId, classes,
+ initialize: function(combobox, listId, parentListId, valueFieldId, fieldId, buttonId, buttonBGId, shadowId, commonStyles, userStyles,
listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue,
selectFirstOnUpdate, onlistcall, onselected, defaultMessage, isDisabled, value,
showDelay, hideDelay) {
this.directInputSuggestions = directInputSuggestions;
this.filterNewValue = filterNewValue;
-
this.combobox = $(combobox);
this.comboValue = $(valueFieldId);
this.field = $(fieldId);
this.BUTTON_WIDTH = 17; //px
+ this.classes = Richfaces.mergeStyles(userStyles,commonStyles);
+
//this.field.prevValue = null;
this.button = $(buttonId);
@@ -28,10 +29,10 @@
// fieldDem.height = this.field.offsetHeight;
listWidth = (!listWidth) ? this.getCurrentWidth() : listWidth;
- this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate, filterNewValue, classes.COMBO_LIST, listWidth,
+ this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate, filterNewValue, this.classes.combolist, listWidth,
listHeight, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay);
this.defaultMessage = defaultMessage;
- this.classes = classes;
+
if (value) {
var item = this.comboList.findItemBySubstr(value);
if (item) {
@@ -110,39 +111,39 @@
buttonMouseUpHandler : function(e) {
this.buttonBG.className = "rich-combobox-font rich-combobox-button-background rich-combobox-button";
- this.button.className = this.classes.BUTTON.CLASSES.ACTIVE + " rich-combobox-button-hovered";
+ this.button.className = this.classes.button.classes.active + " rich-combobox-button-hovered";
this.field.focus();
},
buttonMousedownHandler : function(e) {
this.buttonBG.className = "rich-combobox-font rich-combobox-button-pressed-background rich-combobox-button";
- this.button.className = this.classes.BUTTON.CLASSES.ACTIVE + " rich-combobox-button-hovered";
+ this.button.className = this.classes.button.classes.active + " rich-combobox-button-hovered";
this.comboList.isList = true;
},
buttonMouseOverHandler : function(e) {
- var classCss = this.classes.BUTTON.CLASSES;
- var iconStyles = this.classes.BUTTONICON.STYLE;
+ var classCss = this.classes.button.classes;
+ var iconStyles = this.classes.buttonicon.style;
if (this.isActive()) {
- this.button.className= classCss.ACTIVE + " " + classCss.HOVERED;
- this.button.style.backgroundImage = iconStyles.ACTIVE;
+ this.button.className= classCss.active + " " + classCss.hovered;
+ this.button.style.backgroundImage = iconStyles.active;
} else {
- this.button.className = classCss.NORMAL + " " + classCss.HOVERED;
- this.button.style.backgroundImage = iconStyles.NORMAL;
+ this.button.className = classCss.normal + " " + classCss.hovered;
+ this.button.style.backgroundImage = iconStyles.normal;
}
},
buttonMouseOutHandler : function(e) {
- var classCss = this.classes.BUTTON.CLASSES;
- var iconStyles = this.classes.BUTTONICON.STYLE;
+ var classCss = this.classes.button.classes;
+ var iconStyles = this.classes.buttonicon.style;
if (this.isActive()) {
- this.button.className= classCss.ACTIVE;
- this.button.style.backgroundImage = iconStyles.ACTIVE;
+ this.button.className= classCss.active;
+ this.button.style.backgroundImage = iconStyles.active;
} else {
- this.button.className = classCss.NORMAL;
- this.button.style.backgroundImage = iconStyles.NORMAL;
+ this.button.className = classCss.normal;
+ this.button.style.backgroundImage = iconStyles.normal;
}
},
@@ -328,38 +329,38 @@
},
applyDefaultText : function() {
- this.field.className = this.classes.FIELD.CLASSES.DISABLED;
+ this.field.className = this.classes.field.classes.disabled;
this.field.value = this.defaultMessage;
this.comboValue.value = "";
},
isActive : function() {
- return (this.field.className == this.classes.FIELD.CLASSES.ACTIVE);
+ return (this.field.className == this.classes.field.classes.active);
},
doActive : function() {
- if (this.button.className.indexOf(this.classes.BUTTON.CLASSES.HOVERED) != -1) {
- this.button.className = this.classes.BUTTON.CLASSES.ACTIVE + " " + this.classes.BUTTON.CLASSES.HOVERED;
+ if (this.button.className.indexOf(this.classes.button.classes.hovered) != -1) {
+ this.button.className = this.classes.button.classes.active + " " + this.classes.button.classes.hovered;
} else {
- this.button.className = this.classes.BUTTON.CLASSES.ACTIVE ;
+ this.button.className = this.classes.button.classes.active ;
}
- var iconStyles = this.classes.BUTTONICON.STYLE;
- this.button.style.backgroundImage = iconStyles.ACTIVE;
+ var iconStyles = this.classes.buttonicon.style;
+ this.button.style.backgroundImage = iconStyles.active;
- this.field.className = this.classes.FIELD.CLASSES.ACTIVE;
- Element.setStyle(this.field, this.classes.FIELD.STYLE.ACTIVE);
+ this.field.className = this.classes.field.classes.active;
+ Element.setStyle(this.field, this.classes.field.style.active);
this.isDisabled = false;
},
disable : function() {
- this.button.className = this.classes.BUTTON.CLASSES.DISABLED;
- this.buttonBG.className = this.classes.BUTTONBG.CLASSES.DISABLED;
- this.field.className = this.classes.FIELD.CLASSES.DISABLED;
- Element.setStyle(this.field, this.classes.FIELD.STYLE.DISABLED);
+ this.button.className = this.classes.button.classes.disabled;
+ this.buttonBG.className = this.classes.buttonbg.classes.disabled;
+ this.field.className = this.classes.field.classes.disabled;
+ Element.setStyle(this.field, this.classes.field.style.disabled);
- var iconStyles = this.classes.BUTTONICON.STYLE;
- this.button.style.backgroundImage = iconStyles.DISABLED;
+ var iconStyles = this.classes.buttonicon.style;
+ this.button.style.backgroundImage = iconStyles.disabled;
this.button.disabled = true;
this.field.disabled = true;
@@ -369,13 +370,13 @@
},
enable : function() {
- this.button.className = this.classes.BUTTON.CLASSES.NORMAL;
- this.buttonBG.className = this.classes.BUTTONBG.CLASSES.NORMAL;
- this.field.className = this.classes.FIELD.CLASSES.NORMAL;
- Element.setStyle(this.field, this.classes.FIELD.STYLE.NORMAL);
+ this.button.className = this.classes.button.classes.normal;
+ this.buttonBG.className = this.classes.buttonbg.classes.normal;
+ this.field.className = this.classes.field.classes.normal;
+ Element.setStyle(this.field, this.classes.field.style.normal);
- var iconStyles = this.classes.BUTTONICON.STYLE;
- this.button.style.backgroundImage = iconStyles.NORMAL;
+ var iconStyles = this.classes.buttonicon.style;
+ this.button.style.backgroundImage = iconStyles.normal;
this.button.disabled = false;
this.field.disabled = false;
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-09-26 15:02:22 UTC (rev 10579)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-09-26 15:02:46 UTC (rev 10580)
@@ -22,7 +22,6 @@
this.selectFirstOnUpdate = selectFirstOnUpdate;
this.filterNewValues = filterNewValues;
- this.classes = classes;
this.isList = false;
this.defaultRowsAmount = 15;
@@ -32,10 +31,9 @@
this.showDelay = showDelay;
this.hideDelay = hideDelay;
-
+ this.classes = classes;
this.width = width;
this.height = height;
-
this.initDimensions();
},
@@ -57,7 +55,7 @@
createDefaultList : function() {
var items = new Array();
for (var i = 0; i < this.itemsText.length; i++) {
- items.push(this.createItem(this.itemsText[i], this.classes.ITEM.NORMAL));
+ items.push(this.createItem(this.itemsText[i], this.classes.item.normal));
}
this.createNewList(items);
},
@@ -287,12 +285,12 @@
this.activeItem = item;
- this.changeItem(item, this.classes.ITEM.SELECTED);
+ this.changeItem(item, this.classes.item.selected);
},
doNormalItem : function(item) {
this.activeItem = null;
- this.changeItem(item, this.classes.ITEM.NORMAL);
+ this.changeItem(item, this.classes.item.normal);
},
doSelectItem : function(item) {
@@ -374,7 +372,7 @@
for (var i = 0; i < this.itemsText.length; i++) {
var itText = this.itemsText[i];
if (itText.substr(0, text.length).toLowerCase() == text.toLowerCase()) { //FIXME: to optimaize
- items.push(this.createItem(itText, this.classes.ITEM.NORMAL));
+ items.push(this.createItem(itText, this.classes.item.normal));
}
}
return items;
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-09-26 15:02:22 UTC (rev 10579)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-09-26 15:02:46 UTC (rev 10580)
@@ -21,6 +21,7 @@
scripts/comboboxUtils.js,
scripts/combolist.js,
scripts/combobox.js,
+ scripts/comboboxstyles.js,
/org/richfaces/renderkit/html/scripts/utils.js
</h:scripts>
@@ -278,45 +279,62 @@
var clientId = '#{clientId}';
RichComboUtils.execOnLoad( function(){
- Richfaces.ComboBox.CLASSES = {
- BUTTON : {CLASSES :
- {NORMAL : "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive #{buttonInactiveClass}",
- ACTIVE : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}",
- DISABLED : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled #{buttonDisabledClass}",
- HOVERED : "rich-combobox-button-hovered"},
- STYLE :
- {NORMAL: "#{buttonInactiveStyle}",
- ACTIVE: "#{buttonStyle}",
- DISABLED: "#{buttonDisabledStyle}"}
- },
- BUTTONBG : {CLASSES :
- {NORMAL:"rich-combobox-font-inactive rich-combobox-button-background-inactive rich-combobox-button-inactive",
- ACTIVE: "rich-combobox-font rich-combobox-button-background rich-combobox-button",
- DISABLED : "rich-combobox-font-disabled rich-combobox-button-background-disabled rich-combobox-button-disabled"}
- },
- BUTTONICON : {STYLE :
- {NORMAL: "#{buttonIconInactive}",
- ACTIVE: "#{buttonIcon}",
- DISABLED: "#{buttonIconDisabled}"}
- },
- FIELD : {CLASSES:
- {NORMAL : "rich-combobox-font-inactive rich-combobox-input-inactive #{inputInactiveClass}",
- ACTIVE : "rich-combobox-font rich-combobox-input #{inputClass}",
- DISABLED : "rich-combobox-font-disabled rich-combobox-input-disabled #{inputDisabledClass}"},
- STYLE :
- {NORMAL : "#{inputInactiveStyle}",
- ACTIVE : "#{inputStyle}",
- DISABLED : "#{inputDisabledStyle}"}
- },
- COMBO_LIST : {
- LIST : {CLASSES :{ACTIVE : "rich-combobox-list-cord rich-combobox-list-scroll rich-combobox-list-decoration rich-combobox-list-position #{listClass}"},
- STYLE : {ACTIVE: "#{listStyle}"}
- },
- ITEM : {NORMAL : "rich-combobox-item #{itemClass}",
- SELECTED : "rich-combobox-item rich-combobox-item-selected #{itemSelectedClass}"
- }
+
+ var comboboxUserStyles = {
+ button : {
+ classes :
+ {
+ normal: "#{buttonInactiveClass}",
+ active: "#{buttonClass}",
+ disabled: "#{buttonDisabledClass}"
+ },
+ style :
+ {
+ normal: "#{buttonInactiveStyle}",
+ active: "#{buttonStyle}",
+ disabled: "#{buttonDisabledStyle}"
+ }
+ },
+ buttonicon : {
+ style :
+ {
+ normal: "#{buttonIconInactive}",
+ active: "#{buttonIcon}",
+ disabled: "#{buttonIconDisabled}"
+ }
+ },
+ field : {
+ classes :
+ {
+ normal: "#{inputInactiveClass}",
+ active: "#{inputClass}",
+ disabled: "#{inputDisabledClass}"
+ },
+ style :
+ {
+ normal : "#{inputInactiveStyle}",
+ active : "#{inputStyle}",
+ disabled : "#{inputDisabledStyle}"
+ }
+ },
+ combolist : {
+ list: {
+ classes:
+ {
+ active: "#{listClass}"
+ },
+ style:
+ {
+ active: "'#{listStyle}"
+ }
+ },
+ item: {
+ normal : "#{itemClass}",
+ selected: "#{itemSelectedClass}"
+ }
}
- }
+ };
+
var combobox = new Richfaces.ComboBox( "#{clientId}",
"#{clientId}list",
@@ -326,7 +344,8 @@
"#{clientId}comboboxButton",
"#{clientId}comboBoxButtonBG",
"#{clientId}shadow",
- Richfaces.ComboBox.CLASSES,
+ Richfaces.ComboBox.classes,
+ comboboxUserStyles,
"#{listWidth}", "#{listHeight}",
#{this:getItemsTextAsJSArray(context, component,items)},
#{directInputSuggestions},
16 years, 3 months