JBoss Rich Faces SVN: r5625 - in branches/3.1.x/ui/core/src/main/java/org: ajax4jsf/component and 35 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-01-25 09:09:38 -0500 (Fri, 25 Jan 2008)
New Revision: 5625
Added:
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/html/
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/html/package-info.java
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/package-info.java
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/html/package-info.java
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/package-info.java
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/events/
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/events/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/html/
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/html/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/events/
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/events/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/xml/
branches/3.1.x/ui/core/src/main/java/org/richfaces/component/xml/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/convert/
branches/3.1.x/ui/core/src/main/java/org/richfaces/convert/selection/
branches/3.1.x/ui/core/src/main/java/org/richfaces/convert/selection/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/event/
branches/3.1.x/ui/core/src/main/java/org/richfaces/event/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/event/sort/
branches/3.1.x/ui/core/src/main/java/org/richfaces/event/sort/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/model/
branches/3.1.x/ui/core/src/main/java/org/richfaces/model/internal/
branches/3.1.x/ui/core/src/main/java/org/richfaces/model/internal/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/model/selection/
branches/3.1.x/ui/core/src/main/java/org/richfaces/model/selection/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/gradientimages/
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/gradientimages/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/iconimages/
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/iconimages/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/background/
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/background/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/buttons/
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/buttons/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/images/
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/images/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/taglib/
branches/3.1.x/ui/core/src/main/java/org/richfaces/taglib/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/html/
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/html/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/renderkit/
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/renderkit/html/
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/renderkit/html/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/taglib/
branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/taglib/package-info.java
branches/3.1.x/ui/core/src/main/java/org/richfaces/util/
branches/3.1.x/ui/core/src/main/java/org/richfaces/util/package-info.java
Log:
http://jira.jboss.com/jira/browse/RF-971 - API docs merged
Added: branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/html/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/html/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/html/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Specialized user interface component classes for HTML
+ */
+package org.ajax4jsf.component.html;
Added: branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/component/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Fundamental APIs for ajax core components
+ */
+package org.ajax4jsf.component;
Added: branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/html/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/html/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/html/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Tag library contains facelets tag handlers that are useful in creating dynamic reusable components
+ */
+package org.ajax4jsf.renderkit.html;
Added: branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Fundamental classes and interfaces defining the rendering model
+ */
+package org.ajax4jsf.renderkit;
Added: branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Classes defining the rendering model for HTML
+ */
+package org.ajax4jsf.taglib.html.facelets;
Added: branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Tag library contains JSP tags that are useful in creating dynamic reusable components
+ */
+package org.ajax4jsf.taglib.html.jsp;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/component/events/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/component/events/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/component/events/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Fundamental APIs for component events
+ */
+package org.richfaces.component.events;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/component/html/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/component/html/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/component/html/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Specialized user interface component classes for HTML
+ */
+package org.richfaces.component.html;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/component/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/component/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Fundamental APIs for user interface components
+ */
+package org.richfaces.component;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/events/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/events/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/events/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Provides classes and interfaces describing state events
+ */
+package org.richfaces.component.state.events;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/component/state/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Provides classes and interfaces describing component states
+ */
+package org.richfaces.component.state;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/component/xml/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/component/xml/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/component/xml/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Defines classes responsible for XML functionality
+ */
+package org.richfaces.component.xml;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/convert/selection/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/convert/selection/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/convert/selection/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Defines classes responsible for selection functionality
+ */
+package org.richfaces.convert.selection;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/event/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/event/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/event/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Interfaces describing events and event listeners, and concrete event implementation classes
+ */
+package org.richfaces.event;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/event/sort/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/event/sort/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/event/sort/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Defines classes responsible for sort events
+ */
+package org.richfaces.event.sort;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/model/internal/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/model/internal/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/model/internal/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Defines classes for component specific models
+ */
+package org.richfaces.model.internal;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/model/selection/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/model/selection/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/model/selection/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Defines classes for selection model
+ */
+package org.richfaces.model.selection;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/gradientimages/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/gradientimages/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/gradientimages/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Provides classes for creating and modifying gradient images
+ */
+package org.richfaces.renderkit.html.gradientimages;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/iconimages/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/iconimages/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/iconimages/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Provides classes for creating and modifying icons images
+ */
+package org.richfaces.renderkit.html.iconimages;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/background/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/background/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/background/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Provides classes for creating and modifying backgrounds
+ */
+package org.richfaces.renderkit.html.images.background;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/buttons/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/buttons/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/buttons/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Provides classes for creating and modifying buttons
+ */
+package org.richfaces.renderkit.html.images.buttons;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/images/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Provides classes for creating and modifying images
+ */
+package org.richfaces.renderkit.html.images;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/html/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Classes defining the rendering model for HTML
+ */
+package org.richfaces.renderkit.html;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/images/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/images/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/images/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Provides base classes for creating and modifying images
+ */
+package org.richfaces.renderkit.images;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/renderkit/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Fundamental classes and interfaces defining the rendering model
+ */
+package org.richfaces.renderkit;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/taglib/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/taglib/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/taglib/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Tag library contains JSP tags that are useful in creating dynamic reusable components
+ */
+package org.richfaces.taglib;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/html/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/html/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/html/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Classes defining the rendering model for HTML
+ */
+package org.richfaces.ui.component.html;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/component/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Defines classes for insert component
+ */
+package org.richfaces.ui.component;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/renderkit/html/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/renderkit/html/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/renderkit/html/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Fundamental classes and interfaces defining the rendering model
+ */
+package org.richfaces.ui.renderkit.html;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/taglib/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/taglib/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/ui/taglib/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Tag library contains JSP tags that are useful in creating dynamic reusable components
+ */
+package org.richfaces.ui.taglib;
Added: branches/3.1.x/ui/core/src/main/java/org/richfaces/util/package-info.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/richfaces/util/package-info.java (rev 0)
+++ branches/3.1.x/ui/core/src/main/java/org/richfaces/util/package-info.java 2008-01-25 14:09:38 UTC (rev 5625)
@@ -0,0 +1,4 @@
+/**
+ * Defines classes for different util
+ */
+package org.richfaces.util;
16 years, 11 months
JBoss Rich Faces SVN: r5624 - in trunk/sandbox/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-25 06:53:53 -0500 (Fri, 25 Jan 2008)
New Revision: 5624
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
fix setWidth method
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-25 11:52:29 UTC (rev 5623)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-25 11:53:53 UTC (rev 5624)
@@ -488,12 +488,13 @@
setWidth : function(width) {
var positionElem = this.listParent.childNodes[2];
var combobox = this.listParent.parentNode;
-
- combobox.style.width = width;
- this.iframe.style.width = width;
+
//positionElem.style.width = width;
-
- this.list.style.width = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr");
+ var correction = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr") + "px";
+ this.list.style.width = correction;
+ combobox.style.width = correction;
+ this.iframe.style.width = correction;
+
},
setPosition : function(fieldTop, fieldLeft, fieldHeight) {
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-25 11:52:29 UTC (rev 5623)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-25 11:53:53 UTC (rev 5624)
@@ -59,9 +59,9 @@
String listWidth = (String) component.getAttributes().get("listWidth");
if (listWidth == null || listWidth.length() == 0 || listWidth.trim().startsWith("0")) {
- String listCorrection = width.substring(0,width.indexOf("px"));
- listCorrection = (Integer.parseInt(listCorrection) - 2) + "px";
- listWidth = listCorrection;
+ // String listCorrection = width.substring(0,width.indexOf("px"));
+ // listCorrection = (Integer.parseInt(listCorrection) - 2) + "px";
+ listWidth = width;
} else {
listWidth = HtmlUtil.qualifySize(listWidth);
}
16 years, 11 months
JBoss Rich Faces SVN: r5623 - trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-25 06:52:29 -0500 (Fri, 25 Jan 2008)
New Revision: 5623
Modified:
trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images/ComboBoxButtonGradient.java
trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images/ComboBoxButtonPressGradient.java
Log:
new skin colors for gradient
Modified: trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images/ComboBoxButtonGradient.java
===================================================================
--- trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images/ComboBoxButtonGradient.java 2008-01-25 11:22:23 UTC (rev 5622)
+++ trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images/ComboBoxButtonGradient.java 2008-01-25 11:52:29 UTC (rev 5623)
@@ -13,6 +13,6 @@
*/
public class ComboBoxButtonGradient extends BaseGradient {
public ComboBoxButtonGradient() {
- super(8, 18, 9,"tabBackgroundColor", Skin.headerBackgroundColor);
+ super(8, 18, 9,"headerGradientColor",Skin.headerBackgroundColor) ;
}
}
Modified: trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images/ComboBoxButtonPressGradient.java
===================================================================
--- trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images/ComboBoxButtonPressGradient.java 2008-01-25 11:22:23 UTC (rev 5622)
+++ trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/images/ComboBoxButtonPressGradient.java 2008-01-25 11:52:29 UTC (rev 5623)
@@ -13,7 +13,7 @@
public class ComboBoxButtonPressGradient extends BaseGradient{
public ComboBoxButtonPressGradient() {
- super(7,15 , 9, Skin.headerBackgroundColor, "tabBackgroundColor");
+ super(7,15 , 9, Skin.headerBackgroundColor, "headerGradientColor");
}
}
16 years, 11 months
JBoss Rich Faces SVN: r5622 - branches/3.1.x/ui/message/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-01-25 06:22:23 -0500 (Fri, 25 Jan 2008)
New Revision: 5622
Modified:
branches/3.1.x/ui/message/src/main/config/component/message.xml
Log:
http://jira.jboss.com/jira/browse/RF-1981
Modified: branches/3.1.x/ui/message/src/main/config/component/message.xml
===================================================================
--- branches/3.1.x/ui/message/src/main/config/component/message.xml 2008-01-25 10:58:24 UTC (rev 5621)
+++ branches/3.1.x/ui/message/src/main/config/component/message.xml 2008-01-25 11:22:23 UTC (rev 5622)
@@ -253,8 +253,7 @@
</description>
</property>
- &ui_component_attributes;
- &ajax_output_attributes;
+ &ui_component_attributes;
</component>
<component>
@@ -521,9 +520,16 @@
The attribute takes a value-binding expression for a component property of a backing bean
</description>
</property>
+ <property hidden="true">
+ <name>headerLocation</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property hidden="true">
+ <name>var</name>
+ <classname>java.lang.String</classname>
+ </property>
&ui_component_attributes;
- &ajax_output_attributes;
- </component>
+ </component>
</components>
\ No newline at end of file
16 years, 11 months
JBoss Rich Faces SVN: r5621 - in branches/3.1.x/ui/panelbar/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-01-25 05:58:24 -0500 (Fri, 25 Jan 2008)
New Revision: 5621
Modified:
branches/3.1.x/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java
branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
branches/3.1.x/ui/panelbar/src/main/templates/panelBar.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1916
Modified: branches/3.1.x/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java
===================================================================
--- branches/3.1.x/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java 2008-01-25 10:21:14 UTC (rev 5620)
+++ branches/3.1.x/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java 2008-01-25 10:58:24 UTC (rev 5621)
@@ -22,22 +22,30 @@
package org.richfaces.renderkit.html;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import javax.faces.el.ValueBinding;
import org.ajax4jsf.javascript.AjaxScript;
import org.ajax4jsf.javascript.ImageCacheScript;
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.javascript.PrototypeScript;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.resource.InternetResource;
import org.richfaces.component.UIPanelBar;
import org.richfaces.component.UIPanelBarItem;
import org.richfaces.event.SwitchablePanelSwitchEvent;
+import org.richfaces.renderkit.ScriptOptions;
public abstract class PanelBarRendererBase extends HeaderResourcesRendererBase {
@@ -118,4 +126,88 @@
}*/
}
+ protected List getScriptPanelBarItems(FacesContext context,UIPanelBar panelBar){
+ List items = new ArrayList();
+ JSReference id_ref = new JSReference("id");
+
+ List children = panelBar.getChildren();
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ UIComponent child = (UIComponent) iterator.next();
+
+ if(child instanceof UIPanelBarItem){
+
+ Map item = new HashMap();
+ UIPanelBarItem panelBarItem = (UIPanelBarItem) child;
+ item.put(id_ref, panelBarItem.getClientId(context));
+
+ Object enterScript = panelBarItem.getAttributes().get("onenter");
+ Object leaveScript = panelBarItem.getAttributes().get("onleave");
+
+ if (enterScript != null && !enterScript.equals("")) {
+ JSFunctionDefinition onenter = new JSFunctionDefinition();
+ onenter.addParameter("event");
+ onenter.addToBody(enterScript);
+ item.put("onenter", onenter);
+ } else {
+ item.put("onenter", "");
+ }
+
+ if (leaveScript != null && !leaveScript.equals("")) {
+ JSFunctionDefinition onleave = new JSFunctionDefinition();
+ onleave.addParameter("event");
+ onleave.addToBody(leaveScript);
+ item.put("onleave", onleave);
+ } else {
+ item.put("onleave", "");
+ }
+
+ items.add(item);
+ }
+ }
+
+ return items;
+ }
+
+ public void encodeScript(FacesContext context, UIComponent component) throws IOException{
+
+ if(component instanceof UIPanelBar){
+ UIPanelBar panelBar = (UIPanelBar)component;
+
+ List items = getScriptPanelBarItems(context, panelBar);
+
+ ScriptOptions options = new ScriptOptions(component);
+
+
+ Object changeScript = panelBar.getAttributes().get("onitemchange");
+
+ if (changeScript != null && !changeScript.equals("")) {
+ JSFunctionDefinition function = new JSFunctionDefinition();
+ function.addParameter("event");
+ function.addToBody(changeScript);
+ options.addOption("onitemchange",function);
+ } else {
+ options.addOption("onitemchange","");
+ }
+
+ options.addOption("onclick", panelBar.getAttributes().get("onclick"));
+ options.addOption("mouseover", panelBar.getAttributes().get("onmouseover"));
+ options.addOption("mouseout", panelBar.getAttributes().get("onmouseout"));
+ options.addOption("mousemove", panelBar.getAttributes().get("onmousemove"));
+ options.addOption("items", items);
+
+
+ StringBuffer script = new StringBuffer();
+ JSFunction function = new JSFunction("new Richfaces.PanelBar");
+ function.addParameter(panelBar.getClientId(context));
+ function.addParameter(options);
+ function.appendScript(script);
+
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement(HTML.SCRIPT_ELEM, panelBar);
+ writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
+ String outerScript = script.append(";").toString();
+ writer.write(outerScript);
+ writer.endElement(HTML.SCRIPT_ELEM);
+ }
+ }
}
Modified: branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
===================================================================
--- branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2008-01-25 10:21:14 UTC (rev 5620)
+++ branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2008-01-25 10:58:24 UTC (rev 5621)
@@ -5,9 +5,9 @@
Richfaces.PanelBar.prototype = {
- initialize: function(panelId, onclick) {
+ initialize: function(panelId, options) {
- this.FF = (RichFaces.navigatorType() == "FF")?true:false;
+ this.FF = (RichFaces.navigatorType() == RichFaces.FF)?true:false;
this.isIE = ((navigator.userAgent.toLowerCase().indexOf("msie")!=-1) || (navigator.userAgent.toLowerCase().indexOf("explorer")!=-1))?true:false;
this.panel=$(panelId); //+"_p"
@@ -19,8 +19,11 @@
this.STEP=0;
this.slides=new Array();
this.ch=this.panel.clientHeight;
-
- this.onclick = onclick;
+ this.options = options;
+ this.onitemchange = options.onitemchange;
+ this.onclick = options.onclick;
+ this.items = options.items;
+
this._attachBehaviors();
this.input=$(panelId+"_panelBarInput");
@@ -29,6 +32,23 @@
Event.observe(window,'load',this.handleOnLoad.bindAsEventListener(this));
+ this.mouseover = options.mouseover;
+ this.mouseout = options.mouseout;
+ this.mousemove = options.mousemove;
+
+
+ if (this.mouseover && this.mouseover != ""){
+ Event.observe(this.panel,'mouseover',new Function("event",this.mouseover));
+ }
+
+ if (this.mouseout && this.mouseout != ""){
+ Event.observe(this.panel,'mouseout',new Function("event",this.mouseout));
+ }
+
+ if (this.mousemove && this.mousemove != ""){
+ Event.observe(this.panel,'mousemove',new Function("event", this.mousemove));
+ }
+
this.showSlide(this.slides[this.defaultIndex]);
this.contentHight = -1;
@@ -84,17 +104,28 @@
this.current=slide;
// this.input.value=this.current.index;
this.input.value=this.current.item.id;
-
+ this.firstLoad = false;
},
_attachBehaviors: function() {
- var rows=this._getDirectChildrenByTag(this.panel,'DIV');
+ var rows=this._getItems(this.panel);
for(var i=0; i<rows.length; i++) {
var subrows=this._getDirectChildrenByTag(rows[i],'DIV');
this.slides.push(new Richfaces.PanelBar.Slide(this,rows[i],subrows[0],subrows[1],subrows[2],i,this.onclick)); //ndex
}
},
+ _getItems: function( e ) {
+ var kids = new Array();
+ var itemsLength = this.items.length;
+ for (var item = e.firstChild, index = 0; item && index < itemsLength; item = item.nextSibling) {
+ if (this.items[index].id == item.id) {
+ index++;
+ kids.push(item);
+ }
+ }
+ return kids;
+ },
_getDirectChildrenByTag: function( e, tagName ) {
@@ -115,9 +146,45 @@
if (this.slides[i].item.id==value) return i;
}
return 0;
+ },
+
+ invokeEvent: function(eventName, event, leaveElement,enterElement, element, eventFunction, data) {
+ var result;
+ if (eventFunction) {
+
+ var eventObj;
+
+ if (event)
+ {
+ eventObj = event;
+ }
+ else if( document.createEventObject )
+ {
+ eventObj = document.createEventObject();
+ }
+ else if( document.createEvent )
+ {
+ eventObj = document.createEvent('Events');
+ eventObj.initEvent( eventName, true, false );
}
+ eventObj.rich = {component:this};
+ eventObj.rich.enterElement = leaveElement;
+ eventObj.rich.leaveElement = enterElement;
+
+ try
+ {
+ result = eventFunction.call(element, eventObj);
+ }
+ catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
+ }
+
+ if (result!=false) result = true;
+
+ return result;
+ }
+
}
Richfaces.PanelBar.Slide = Class.create();
@@ -131,6 +198,9 @@
this.header=header;
this.header_act=header_act;
this.content=content;
+ this.onclick = onclick;
+
+// this.item.style.overflow="hidden";
// this.header.style.overflowX="hidden";
// this.header.style.overflowY="visible";
// this.header.style.cursor="pointer";
@@ -152,8 +222,8 @@
}
}
- if (onclick && onclick != ""){
- this.onclickFunction = new Function("return " + onclick + ";").bindAsEventListener(this);
+ if (this.onclick && this.onclick != ""){
+ this.onclickFunction = new Function("event",this.onclick);
}
},
@@ -175,17 +245,35 @@
this.header.style.display="";
},
- headerOnClick: function() {
+ headerOnClick: function(event) {
if (this.onclickFunction){
- var result = this.onclickFunction();
- if (result != undefined && !result) {
- return;
+ var result = this.onclickFunction(event);
+ if (result == false) {
+ return false;
}
}
if (this.content.style.display=="block") return;
//this.header.style.display="none";
//this.header_act.style.display="";
+
+ var enterElement = this.item;
+ var leaveElement = this.slidePanel.current.item;
+ var enterItem = this.slidePanel.items[this.index];
+ var leaveItem;
+ var items = this.slidePanel.items;
+
+ for (var i = 0; i < items.length; i++) {
+ if (this.slidePanel.items[i].id == leaveElement.id) {
+ leaveItem = this.slidePanel.items[i];
+ }
+ }
+
+
+ if(!this.slidePanel.invokeEvent("onenter",event,leaveElement, enterElement,enterElement,enterItem.onenter)) return false;
+ if(!this.slidePanel.invokeEvent("onleave",event,leaveElement, enterElement,leaveElement,leaveItem.onleave)) return false;
+ if(!this.slidePanel.invokeEvent("onchangeitem",event,leaveElement, enterElement,this.slidePanel.panel,this.slidePanel.onitemchange)) return false;
+
this.slidePanel.showSlide(this);
this.slidePanel.panel.style.maxHeight="";
this.slidePanel.panel.style.minHeight="";
Modified: branches/3.1.x/ui/panelbar/src/main/templates/panelBar.jspx
===================================================================
--- branches/3.1.x/ui/panelbar/src/main/templates/panelBar.jspx 2008-01-25 10:21:14 UTC (rev 5620)
+++ branches/3.1.x/ui/panelbar/src/main/templates/panelBar.jspx 2008-01-25 10:58:24 UTC (rev 5621)
@@ -20,7 +20,7 @@
<f:clientid var="clientId" />
<input type="hidden" name="#{clientId}" id="#{clientId}_panelBarInput"
value="#{this:expanded(context, component)}"/>
- <script type="text/javascript">new Richfaces.PanelBar("#{clientId}", "#{component.attributes['onclick']}");</script>
+ <f:call name="encodeScript"/>
</div>
</f:root>
16 years, 11 months
JBoss Rich Faces SVN: r5620 - in branches/3.1.x/test-applications: jsp/src/main/webapp/DataScroller and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: viktor_volkov
Date: 2008-01-25 05:21:14 -0500 (Fri, 25 Jan 2008)
New Revision: 5620
Modified:
branches/3.1.x/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml
branches/3.1.x/test-applications/jsp/src/main/webapp/DataScroller/DataScroller.jsp
Log:
all styles and style classes were added to component code
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml 2008-01-25 09:27:00 UTC (rev 5619)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml 2008-01-25 10:21:14 UTC (rev 5620)
@@ -14,6 +14,14 @@
onkeypress="showEvent('onkeypressInputID', 'onkeypress work!')"
onkeyup="showEvent('onkeyupInputID', 'onkeyup work!')" onmousedown="showEvent('onmousedownInputID', 'onmousedown work!')"
onmousemove="showEvent('onmousemoveInputID', 'onmousemove work!')" onmouseout="showEvent('onmouseoutInputID', 'onmouseout work!')"
+ inactiveStyle="inactiveStyle"
+ selectedStyle="selectedStyle"
+ tableStyleClass="tableStyleClass"
+ styleClass="styleClass"
+ selectedStyleClass="selectedStyleClass"
+ inactiveStyleClass="inactiveStyleClass"
+ style="style"
+ tableStyle="tableStyle"
onmouseover="showEvent('onmouseoverInputID', 'onmouseover work!')" onmouseup="showEvent('onmouseupInputID', 'onmouseup work!')"/>
</f:facet>
<h:column>
Modified: branches/3.1.x/test-applications/jsp/src/main/webapp/DataScroller/DataScroller.jsp
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/webapp/DataScroller/DataScroller.jsp 2008-01-25 09:27:00 UTC (rev 5619)
+++ branches/3.1.x/test-applications/jsp/src/main/webapp/DataScroller/DataScroller.jsp 2008-01-25 10:21:14 UTC (rev 5620)
@@ -18,6 +18,14 @@
onkeypress="showEvent('onkeypressInputID', 'onkeypress work!')"
onkeyup="showEvent('onkeyupInputID', 'onkeyup work!')" onmousedown="showEvent('onmousedownInputID', 'onmousedown work!')"
onmousemove="showEvent('onmousemoveInputID', 'onmousemove work!')" onmouseout="showEvent('onmouseoutInputID', 'onmouseout work!')"
+ inactiveStyle="inactiveStyle"
+ selectedStyle="selectedStyle"
+ tableStyleClass="tableStyleClass"
+ styleClass="styleClass"
+ selectedStyleClass="selectedStyleClass"
+ inactiveStyleClass="inactiveStyleClass"
+ style="style"
+ tableStyle="tableStyle"
onmouseover="showEvent('onmouseoverInputID', 'onmouseover work!')" onmouseup="showEvent('onmouseupInputID', 'onmouseup work!')"/>
</f:facet>
<h:column>
16 years, 11 months
JBoss Rich Faces SVN: r5618 - in trunk: ui/orderingList/src/main/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-24 20:36:38 -0500 (Thu, 24 Jan 2008)
New Revision: 5618
Removed:
trunk/ui/orderingList/src/main/java/org/richfaces/component/MessageFactory.java
Modified:
trunk/framework/impl/src/main/java/org/richfaces/component/util/MessageUtil.java
trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
Log:
http://jira.jboss.com/jira/browse/RF-2018
Modified: trunk/framework/impl/src/main/java/org/richfaces/component/util/MessageUtil.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/component/util/MessageUtil.java 2008-01-25 01:23:45 UTC (rev 5617)
+++ trunk/framework/impl/src/main/java/org/richfaces/component/util/MessageUtil.java 2008-01-25 01:36:38 UTC (rev 5618)
@@ -21,8 +21,15 @@
package org.richfaces.component.util;
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
@@ -65,4 +72,87 @@
return o;
}
+
+ private static final ResourceBundle getResourceBundle(String baseName, Locale locale, ClassLoader loader) {
+ if (loader != null) {
+ return ResourceBundle.getBundle(baseName, locale, loader);
+ } else {
+ return ResourceBundle.getBundle(baseName, locale);
+ }
+ }
+
+ private static final FacesMessage getMessage(FacesContext context, String messageId,
+ Object[] parameters, Locale locale) {
+ String summary = null;
+ String detail = null;
+
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ if (context != null) {
+ Application application = context.getApplication();
+ if (application != null) {
+ String messageBundleName = application.getMessageBundle();
+
+ if (messageBundleName != null) {
+ ResourceBundle bundle = getResourceBundle(messageBundleName, locale, loader);
+ if (bundle != null) {
+ try {
+ summary = bundle.getString(messageId);
+ detail = bundle.getString(messageId + "_detail");
+ } catch (MissingResourceException e) {
+ //do nothing
+ }
+ }
+ }
+ }
+ }
+
+ if (summary == null) {
+ ResourceBundle bundle = getResourceBundle(FacesMessage.FACES_MESSAGES, locale, loader);
+ try {
+ summary = bundle.getString(messageId);
+
+ if (summary == null) {
+ return null;
+ }
+
+ detail = bundle.getString(messageId + "_detail");
+ } catch (MissingResourceException e) {
+ //do nothing
+ }
+ }
+
+ String formattedSummary = MessageFormat.format(summary, parameters);
+ String formattedDetail = null;
+ if (detail != null) {
+ formattedDetail = MessageFormat.format(detail, parameters);
+ }
+
+ return new FacesMessage(formattedSummary, formattedDetail);
+ }
+
+ public static final FacesMessage getMessage(FacesContext context, String messageId,
+ Object[] parameters) {
+
+ Locale locale;
+ FacesMessage result = null;
+
+ if (context != null) {
+ UIViewRoot viewRoot = context.getViewRoot();
+ if (viewRoot != null) {
+ locale = viewRoot.getLocale();
+
+ if (locale != null) {
+ result = getMessage(context, messageId, parameters, locale);
+ }
+ }
+ }
+
+ if (result == null) {
+ locale = Locale.getDefault();
+ result = getMessage(context, messageId, parameters, locale);
+ }
+
+ return result;
+ }
}
Deleted: trunk/ui/orderingList/src/main/java/org/richfaces/component/MessageFactory.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/component/MessageFactory.java 2008-01-25 01:23:45 UTC (rev 5617)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/component/MessageFactory.java 2008-01-25 01:36:38 UTC (rev 5618)
@@ -1,22 +0,0 @@
-/**
- *
- */
-package org.richfaces.component;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 05.11.2007
- * @since 3.2
- */
-public class MessageFactory {
-
- public static FacesMessage getMessage(FacesContext context,
- String conversionMessageId) {
- // TODO Auto-generated method stub
- return null;
- }
-}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-01-25 01:23:45 UTC (rev 5617)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-01-25 01:36:38 UTC (rev 5618)
@@ -37,6 +37,7 @@
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.EmptyIterator;
import org.apache.commons.collections.iterators.FilterIterator;
+import org.richfaces.component.util.MessageUtil;
/**
* @author Nick Belaevski
@@ -320,9 +321,11 @@
protected void validateValue(FacesContext context, Object newValue) {
// If our value is valid, enforce the required property if present
if (isValid() && isRequired() && isEmpty(newValue)) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.REQUIRED_MESSAGE_ID);
+ FacesMessage message = MessageUtil.getMessage(context,
+ UIInput.REQUIRED_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
message.setSeverity(FacesMessage.SEVERITY_ERROR);
+
context.addMessage(getClientId(context), message);
setValid(false);
}
@@ -431,7 +434,8 @@
FacesMessage message = null;
if (null == messageStr) {
message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
}
else {
message = new FacesMessage(messageStr);
@@ -441,20 +445,23 @@
setValid(false);
}
catch (FacesException e) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ FacesMessage message =
+ MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
message.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(getClientId(context), message);
setValid(false);
} catch (IllegalArgumentException e) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ FacesMessage message =
+ MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
message.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(getClientId(context), message);
setValid(false);
} catch (Exception e) {
FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
message.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(getClientId(context), message);
setValid(false);
@@ -488,8 +495,8 @@
ConverterException ce, Object value) {
FacesMessage message = ce.getFacesMessage();
if (message == null) {
- message = MessageFactory.getMessage(context,
- UIInput.CONVERSION_MESSAGE_ID);
+ message = MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
if (message.getDetail() == null) {
message.setDetail(ce.getMessage());
}
16 years, 11 months
JBoss Rich Faces SVN: r5617 - branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/util.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-24 20:23:45 -0500 (Thu, 24 Jan 2008)
New Revision: 5617
Modified:
branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/util/MessageUtil.java
Log:
http://jira.jboss.com/jira/browse/RF-2018
Modified: branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/util/MessageUtil.java
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/util/MessageUtil.java 2008-01-25 01:23:41 UTC (rev 5616)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/util/MessageUtil.java 2008-01-25 01:23:45 UTC (rev 5617)
@@ -21,8 +21,15 @@
package org.richfaces.component.util;
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
@@ -65,4 +72,87 @@
return o;
}
+
+ private static final ResourceBundle getResourceBundle(String baseName, Locale locale, ClassLoader loader) {
+ if (loader != null) {
+ return ResourceBundle.getBundle(baseName, locale, loader);
+ } else {
+ return ResourceBundle.getBundle(baseName, locale);
+ }
+ }
+
+ private static final FacesMessage getMessage(FacesContext context, String messageId,
+ Object[] parameters, Locale locale) {
+ String summary = null;
+ String detail = null;
+
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ if (context != null) {
+ Application application = context.getApplication();
+ if (application != null) {
+ String messageBundleName = application.getMessageBundle();
+
+ if (messageBundleName != null) {
+ ResourceBundle bundle = getResourceBundle(messageBundleName, locale, loader);
+ if (bundle != null) {
+ try {
+ summary = bundle.getString(messageId);
+ detail = bundle.getString(messageId + "_detail");
+ } catch (MissingResourceException e) {
+ //do nothing
+ }
+ }
+ }
+ }
+ }
+
+ if (summary == null) {
+ ResourceBundle bundle = getResourceBundle(FacesMessage.FACES_MESSAGES, locale, loader);
+ try {
+ summary = bundle.getString(messageId);
+
+ if (summary == null) {
+ return null;
+ }
+
+ detail = bundle.getString(messageId + "_detail");
+ } catch (MissingResourceException e) {
+ //do nothing
+ }
+ }
+
+ String formattedSummary = MessageFormat.format(summary, parameters);
+ String formattedDetail = null;
+ if (detail != null) {
+ formattedDetail = MessageFormat.format(detail, parameters);
+ }
+
+ return new FacesMessage(formattedSummary, formattedDetail);
+ }
+
+ public static final FacesMessage getMessage(FacesContext context, String messageId,
+ Object[] parameters) {
+
+ Locale locale;
+ FacesMessage result = null;
+
+ if (context != null) {
+ UIViewRoot viewRoot = context.getViewRoot();
+ if (viewRoot != null) {
+ locale = viewRoot.getLocale();
+
+ if (locale != null) {
+ result = getMessage(context, messageId, parameters, locale);
+ }
+ }
+ }
+
+ if (result == null) {
+ locale = Locale.getDefault();
+ result = getMessage(context, messageId, parameters, locale);
+ }
+
+ return result;
+ }
}
16 years, 11 months
JBoss Rich Faces SVN: r5616 - branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-24 20:23:41 -0500 (Thu, 24 Jan 2008)
New Revision: 5616
Removed:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/MessageFactory.java
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
Log:
http://jira.jboss.com/jira/browse/RF-2018
Deleted: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/MessageFactory.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/MessageFactory.java 2008-01-25 01:20:57 UTC (rev 5615)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/MessageFactory.java 2008-01-25 01:23:41 UTC (rev 5616)
@@ -1,22 +0,0 @@
-/**
- *
- */
-package org.richfaces.component;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 05.11.2007
- * @since 3.2
- */
-public class MessageFactory {
-
- public static FacesMessage getMessage(FacesContext context,
- String conversionMessageId) {
- // TODO Auto-generated method stub
- return null;
- }
-}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-01-25 01:20:57 UTC (rev 5615)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-01-25 01:23:41 UTC (rev 5616)
@@ -37,6 +37,7 @@
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.EmptyIterator;
import org.apache.commons.collections.iterators.FilterIterator;
+import org.richfaces.component.util.MessageUtil;
/**
* @author Nick Belaevski
@@ -320,9 +321,11 @@
protected void validateValue(FacesContext context, Object newValue) {
// If our value is valid, enforce the required property if present
if (isValid() && isRequired() && isEmpty(newValue)) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.REQUIRED_MESSAGE_ID);
+ FacesMessage message = MessageUtil.getMessage(context,
+ UIInput.REQUIRED_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
message.setSeverity(FacesMessage.SEVERITY_ERROR);
+
context.addMessage(getClientId(context), message);
setValid(false);
}
@@ -431,7 +434,8 @@
FacesMessage message = null;
if (null == messageStr) {
message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
}
else {
message = new FacesMessage(messageStr);
@@ -441,20 +445,23 @@
setValid(false);
}
catch (FacesException e) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ FacesMessage message =
+ MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
message.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(getClientId(context), message);
setValid(false);
} catch (IllegalArgumentException e) {
- FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ FacesMessage message =
+ MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
message.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(getClientId(context), message);
setValid(false);
} catch (Exception e) {
FacesMessage message =
- MessageFactory.getMessage(context, UIInput.CONVERSION_MESSAGE_ID);
+ MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
message.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(getClientId(context), message);
setValid(false);
@@ -488,8 +495,8 @@
ConverterException ce, Object value) {
FacesMessage message = ce.getFacesMessage();
if (message == null) {
- message = MessageFactory.getMessage(context,
- UIInput.CONVERSION_MESSAGE_ID);
+ message = MessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
if (message.getDetail() == null) {
message.setDetail(ce.getMessage());
}
16 years, 11 months