[richfaces-svn-commits] JBoss Rich Faces SVN: r6032 - trunk/ui/orderingList/src/main/java/org/richfaces/renderkit.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Feb 12 11:33:40 EST 2008


Author: akushunin
Date: 2008-02-12 11:33:40 -0500 (Tue, 12 Feb 2008)
New Revision: 6032

Modified:
   trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
   trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
   trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-2164
fixed bundle search behavior, corrected bundle properties names according to RF-2164


Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java	2008-02-12 16:29:20 UTC (rev 6031)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java	2008-02-12 16:33:40 UTC (rev 6032)
@@ -75,7 +75,7 @@
 	public final static String DISABLED_STYLE_PREF = "-disabled";
 	
 	protected static final OrderingComponentRendererBase.ControlsHelper[] HELPERS = new OrderingComponentRendererBase.ControlsHelper[] {
-		new OrderingComponentRendererBase.ControlsHelper("top", "TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTop.class.getName(), FACET_TOP,
+		new OrderingComponentRendererBase.ControlsHelper("top", "RICH_ORDERING_LIST_TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTop.class.getName(), FACET_TOP,
 						   "-top", ATTRIBUTE_CLASS_TOP_CONTROL, "", 
 						   CONTROL_ID_TOP, ATTRIBUTE_CE_ONTOPCLICK, true, "top".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
 
@@ -84,7 +84,7 @@
 			}
 			
 		},
-		new OrderingComponentRendererBase.ControlsHelper("disabledTop", "TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTopDisabled.class.getName(), FACET_DIS_TOP,
+		new OrderingComponentRendererBase.ControlsHelper("disabledTop", "RICH_ORDERING_LIST_TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTopDisabled.class.getName(), FACET_DIS_TOP,
 						   "-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, DISABLED_STYLE_PREF, 
 						   DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_TOP), null, false, "top".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
 
@@ -93,7 +93,7 @@
 			}
 			
 		},
-		new OrderingComponentRendererBase.ControlsHelper("up", "UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUp.class.getName(), FACET_UP,
+		new OrderingComponentRendererBase.ControlsHelper("up", "RICH_ORDERING_LIST_UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUp.class.getName(), FACET_UP,
 						   "-up", ATTRIBUTE_CLASS_UP_CONTROL, "", 
 						   CONTROL_ID_UP, ATTRIBUTE_CE_ONUPCLICK ,true, "up".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
 
@@ -102,7 +102,7 @@
 			}
 			
 		},
-		new OrderingComponentRendererBase.ControlsHelper("disabledUp", "UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUpDisabled.class.getName(), FACET_DIS_UP,
+		new OrderingComponentRendererBase.ControlsHelper("disabledUp", "RICH_ORDERING_LIST_UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUpDisabled.class.getName(), FACET_DIS_UP,
 						   "-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, DISABLED_STYLE_PREF,
 						   DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_UP), null, false, "up".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
 
@@ -111,7 +111,7 @@
 			}
 			
 		},
-		new OrderingComponentRendererBase.ControlsHelper("down", "DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDown.class.getName(), FACET_DOWN,
+		new OrderingComponentRendererBase.ControlsHelper("down", "RICH_ORDERING_LIST_DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDown.class.getName(), FACET_DOWN,
 						   "-down", ATTRIBUTE_CLASS_DOWN_CONTROL, "",
 						   CONTROL_ID_DOWN, ATTRIBUTE_CE_ONDOWNCLICK, true, "down".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
 
@@ -120,7 +120,7 @@
 			}
 			
 		},
-		new OrderingComponentRendererBase.ControlsHelper("disabledDown", "DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDownDisabled.class.getName(), FACET_DIS_DOWN,
+		new OrderingComponentRendererBase.ControlsHelper("disabledDown", "RICH_ORDERING_LIST_DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDownDisabled.class.getName(), FACET_DIS_DOWN,
 						   "-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, DISABLED_STYLE_PREF, 
 						   DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_DOWN), null, false, "down".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
 
@@ -129,7 +129,7 @@
 			}
 			
 		},
-		new OrderingComponentRendererBase.ControlsHelper("bottom", "BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottom.class.getName(), FACET_BOTTOM,
+		new OrderingComponentRendererBase.ControlsHelper("bottom", "RICH_ORDERING_LIST_BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottom.class.getName(), FACET_BOTTOM,
 						   "-bottom", ATTRIBUTE_CLASS_BOTTOM_CONTROL, "",
 						   CONTROL_ID_BOTTOM, ATTRIBUTE_CE_ONBOTTOMCLICK, true, "bottom".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
 
@@ -138,7 +138,7 @@
 			}
 			
 		},
-		new OrderingComponentRendererBase.ControlsHelper("disabledBottom", "BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottomDisabled.class.getName(), FACET_DIS_BOTTOM,
+		new OrderingComponentRendererBase.ControlsHelper("disabledBottom", "RICH_ORDERING_LIST_BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottomDisabled.class.getName(), FACET_DIS_BOTTOM,
 						   "-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, DISABLED_STYLE_PREF,
 						   DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_BOTTOM), null, false, "bottom".concat(CONTROL_LABEL_ATTRIBUTE_SUFFIX)) {
 

Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java	2008-02-12 16:29:20 UTC (rev 6031)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java	2008-02-12 16:33:40 UTC (rev 6032)
@@ -31,9 +31,10 @@
 
 /**
  * @author Nick Belaevski
- *
+ * 
  */
-public abstract class OrderingComponentRendererBase extends AbstractRowsRenderer {
+public abstract class OrderingComponentRendererBase extends
+		AbstractRowsRenderer {
 
 	private static final Converter DEFAULT_CONVERTER = new Converter() {
 
@@ -48,30 +49,30 @@
 			if (value instanceof String) {
 				return (String) value;
 			}
-			
+
 			if (null == value) {
 				return "";
 			}
-			
+
 			return value.toString();
 		}
 
 	};
-	
+
 	private static final String ITEM_STATE_VAR_NAME = "itemState";
 
 	protected final static String SHOW_LABELS_ATTRIBUTE_NAME = "showButtonLabels";
-	
+
 	protected final static String ATTRIBUTE_CE_ONHEADERCLICK = "onheaderclick";
-	
+
 	protected final static String CONTROL_TYPE_LINK = "link";
-	
+
 	protected final static String CONTROL_TYPE_BUTTON = "button";
-	
+
 	protected final static String CONTROL_TYPE_NONE = "none";
-	
+
 	protected final static String ATTRIBUTE_CONTROLS_TYPE = "controlsType";
-	
+
 	protected static abstract class ControlsHelper {
 		private String name;
 
@@ -97,11 +98,14 @@
 
 		private String labelAttributeName;
 
-		public abstract boolean isRendered(FacesContext context, UIOrderingBaseComponent list);
+		public abstract boolean isRendered(FacesContext context,
+				UIOrderingBaseComponent list);
 
-		public ControlsHelper(String name, String bundlePropertyName, String defaultText, String imageURI,
-				String facetName, String styleClassName, String styleFromAttribute, String buttonStyleClass,
-				String idSuffix, String customEvent, boolean isEnable, String labelAttributeName) {
+		public ControlsHelper(String name, String bundlePropertyName,
+				String defaultText, String imageURI, String facetName,
+				String styleClassName, String styleFromAttribute,
+				String buttonStyleClass, String idSuffix, String customEvent,
+				boolean isEnable, String labelAttributeName) {
 			super();
 			this.name = name;
 			this.bundlePropertyName = bundlePropertyName;
@@ -111,7 +115,7 @@
 			this.styleClassName = styleClassName;
 			this.styleFromAttribute = styleFromAttribute;
 			this.idSuffix = idSuffix;
-			this.customEvent = customEvent; 
+			this.customEvent = customEvent;
 			this.buttonStyleClass = buttonStyleClass;
 			this.enable = isEnable;
 			this.labelAttributeName = labelAttributeName;
@@ -167,23 +171,23 @@
 	}
 
 	protected static final class SelectionState {
-	
+
 		private boolean firstSelected = false;
 		private boolean firstSelectedLatch = false;
-		
+
 		private boolean selectedLatch = false;
 
 		private boolean itemsExist = false;
 
 		private boolean lastSelected = false;
-		
+
 		public SelectionState() {
 			super();
 		}
-		
+
 		public void addState(boolean selected) {
 			itemsExist = true;
-			
+
 			if (!firstSelectedLatch) {
 				firstSelected = selected;
 				firstSelectedLatch = true;
@@ -192,14 +196,14 @@
 			if (selected) {
 				selectedLatch = true;
 			}
-			
+
 			lastSelected = selected;
 		}
-		
+
 		public boolean isFirstSelected() {
 			return firstSelected;
 		}
-		
+
 		public boolean isSelected() {
 			return selectedLatch;
 		}
@@ -207,31 +211,35 @@
 		public boolean isItemExist() {
 			return itemsExist;
 		}
-		
+
 		public boolean isLastSelected() {
 			return lastSelected;
 		}
 	}
 
 	private final String bundleName;
-	
+
 	public OrderingComponentRendererBase(String bundleName) {
 		super();
-		
+
 		this.bundleName = bundleName;
 	}
-	
-	public void encodeCaption(FacesContext context, UIComponent component) throws IOException {
-		encodeCaption(context, component, OrderingComponentControlsHelper.FACET_CAPTION, 
-			"rich-ordering-list-caption");
+
+	public void encodeCaption(FacesContext context, UIComponent component)
+			throws IOException {
+		encodeCaption(context, component,
+				OrderingComponentControlsHelper.FACET_CAPTION,
+				"rich-ordering-list-caption");
 	}
-	
-	protected void encodeCaption(FacesContext context, UIComponent component, 
-			String facetCaption, String captionStyle, String attributeName) throws IOException{
+
+	protected void encodeCaption(FacesContext context, UIComponent component,
+			String facetCaption, String captionStyle, String attributeName)
+			throws IOException {
 		ResponseWriter writer = context.getResponseWriter();
 		UIComponent facetEl = component.getFacet(facetCaption);
 		boolean renderFacet = ((facetEl != null) && facetEl.isRendered());
-		String captionAttr = (String) component.getAttributes().get(attributeName);
+		String captionAttr = (String) component.getAttributes().get(
+				attributeName);
 
 		if (renderFacet || (captionAttr != null)) {
 			writer.startElement(HTML.DIV_ELEM, component);
@@ -244,42 +252,49 @@
 			writer.endElement(HTML.DIV_ELEM);
 		}
 	}
-	
-	protected void encodeCaption(FacesContext context, UIComponent component, String facetCaption, String captionStyle) 
-			throws IOException {
-		encodeCaption(context, component, facetCaption, captionStyle, OrderingComponentControlsHelper.ATTRIBUTE_CAPTION_LABEL);
+
+	protected void encodeCaption(FacesContext context, UIComponent component,
+			String facetCaption, String captionStyle) throws IOException {
+		encodeCaption(context, component, facetCaption, captionStyle,
+				OrderingComponentControlsHelper.ATTRIBUTE_CAPTION_LABEL);
 	}
 
-	public void encodeHeader(FacesContext context, UIOrderingBaseComponent component) 
-	throws IOException {
-		encodeHeader(context, component, "rich-ordering-list-table-header", "rich-ordering-list-table-header-cell", "headerClass");
+	public void encodeHeader(FacesContext context,
+			UIOrderingBaseComponent component) throws IOException {
+		encodeHeader(context, component, "rich-ordering-list-table-header",
+				"rich-ordering-list-table-header-cell", "headerClass");
 	}
-	
-	protected void encodeHeader(FacesContext context, UIOrderingBaseComponent component, String rowClass, 
-								String cellClass, String headerClassAttr) throws IOException {
+
+	protected void encodeHeader(FacesContext context,
+			UIOrderingBaseComponent component, String rowClass,
+			String cellClass, String headerClassAttr) throws IOException {
 		ResponseWriter writer = context.getResponseWriter();
-		//UIComponent header = orderingList.getHeader();
+		// UIComponent header = orderingList.getHeader();
 		Iterator headers = component.columns();
 
 		if (headers.hasNext()) {
 			writer.startElement("thead", component);
-			String headerClass = (String) component.getAttributes().get(headerClassAttr);
+			String headerClass = (String) component.getAttributes().get(
+					headerClassAttr);
 
 			writer.startElement("tr", component);
 			encodeStyleClass(writer, null, rowClass, null, headerClass);
-			encodeHeaderFacets(context, writer, headers, cellClass, headerClass, "header", "th", component);
+			encodeHeaderFacets(context, writer, headers, cellClass,
+					headerClass, "header", "th", component);
 
 			writer.endElement("tr");
-			
+
 			writer.endElement("thead");
 		}
 	}
 
 	protected void renderDefaultControl(FacesContext context,
 			UIOrderingBaseComponent orderingList, ResponseWriter writer,
-			boolean useFacet, OrderingComponentRendererBase.ControlsHelper helper, String clientId, ResourceBundle bundle, 
-			boolean enabled, String baseStyle, String baseControlStyle)
-			throws IOException {
+			boolean useFacet,
+			OrderingComponentRendererBase.ControlsHelper helper,
+			String clientId, ResourceBundle bundleExternal,
+			ResourceBundle bundleApplication, boolean enabled,
+			String baseStyle, String baseControlStyle) throws IOException {
 		UIComponent facet = orderingList.getFacet(helper.getFacetName());
 		String customEvent = null;
 		Map attributes = orderingList.getAttributes();
@@ -300,7 +315,7 @@
 
 		writer.startElement(HTML.DIV_ELEM, orderingList);
 		String controlId = clientId + helper.getIdSuffix();
-		writer.writeAttribute(HTML.id_ATTRIBUTE, controlId, null); //FIXME:
+		writer.writeAttribute(HTML.id_ATTRIBUTE, controlId, null); // FIXME:
 		writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
 		String style = null;
 		if (enabled) {
@@ -310,39 +325,51 @@
 		}
 		writer.writeAttribute(HTML.style_ATTRIBUTE, style, null);
 		if (!useFacet) {
-			
+
 			writer.startElement(HTML.DIV_ELEM, orderingList);
-			writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + helper.getButtonStyleClass(), null);
+			writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle
+					+ helper.getButtonStyleClass(), null);
 			if (helper.enable) {
-				writer.writeAttribute(HTML.onmouseover_ATTRIBUTE, "this.className='" + baseStyleLight + "'", null);
-				writer.writeAttribute(HTML.onmousedown_ATTRIBUTE, "this.className='" + baseStylePress + "'", null);
-				writer.writeAttribute(HTML.onmouseup_ATTRIBUTE, "this.className='" + baseStyle + "'", null);
-				writer.writeAttribute(HTML.onmouseout_ATTRIBUTE, "this.className='" + baseStyle + "'", null);
+				writer.writeAttribute(HTML.onmouseover_ATTRIBUTE,
+						"this.className='" + baseStyleLight + "'", null);
+				writer.writeAttribute(HTML.onmousedown_ATTRIBUTE,
+						"this.className='" + baseStylePress + "'", null);
+				writer.writeAttribute(HTML.onmouseup_ATTRIBUTE,
+						"this.className='" + baseStyle + "'", null);
+				writer.writeAttribute(HTML.onmouseout_ATTRIBUTE,
+						"this.className='" + baseStyle + "'", null);
 			}
-			
+
 			writer.startElement(HTML.a_ELEMENT, orderingList);
-			writer.writeAttribute(HTML.id_ATTRIBUTE, controlId + "link", null); //FIXME:
+			writer.writeAttribute(HTML.id_ATTRIBUTE, controlId + "link", null); // FIXME:
 			writer.writeAttribute(HTML.HREF_ATTR, "#", null);
-			writer.writeAttribute(HTML.onclick_ATTRIBUTE, "return false;", null);
+			writer
+					.writeAttribute(HTML.onclick_ATTRIBUTE, "return false;",
+							null);
 			if (!helper.enable) {
 				writer.writeAttribute(HTML.DISABLED_ATTR, "disabled", null);
-				writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-a-disabled", null);
+				writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle
+						+ "-a-disabled", null);
 				writer.startElement(HTML.a_ELEMENT, orderingList);
 			} else {
-				writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-selection", null);
-				writer.writeAttribute(HTML.onblur_ATTRIBUTE, "Control.onblur(this);", null);
-				writer.writeAttribute(HTML.onfocus_ATTRIBUTE, "Control.onfocus(this);", null);
+				writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle
+						+ "-selection", null);
+				writer.writeAttribute(HTML.onblur_ATTRIBUTE,
+						"Control.onblur(this);", null);
+				writer.writeAttribute(HTML.onfocus_ATTRIBUTE,
+						"Control.onfocus(this);", null);
 			}
-			
+
 			writer.startElement(HTML.DIV_ELEM, orderingList);
-			writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-content", null);
+			writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-content",
+					null);
 
 		}
 
 		if (customEvent != null) {
-			writer.writeAttribute(HTML.onclick_ATTRIBUTE, customEvent,null);
+			writer.writeAttribute(HTML.onclick_ATTRIBUTE, customEvent, null);
 		}
-		
+
 		if (useFacet) {
 			renderChild(context, facet);
 		} else {
@@ -357,21 +384,43 @@
 
 			writer.endElement(HTML.IMG_ELEMENT);
 
-			if (getUtils().isBooleanAttribute(orderingList, SHOW_LABELS_ATTRIBUTE_NAME)) {
-				String label = (String) attributes.get(helper.getLabelAttributeName());
-				
-				if (label == null && bundle != null) {
-					try {
-						label = bundle.getString(helper.getBundlePropertyName());
-					} catch (MissingResourceException e) {
-					
+			if (getUtils().isBooleanAttribute(orderingList,
+					SHOW_LABELS_ATTRIBUTE_NAME)) {
+				String label = (String) attributes.get(helper
+						.getLabelAttributeName());
+
+				if (label == null) {
+					if (null != bundleApplication) {
+						try {
+							label = bundleApplication.getString(helper
+									.getBundlePropertyName());
+						} catch (MissingResourceException e) {
+							try {
+								if (null != bundleExternal) {
+									label = bundleExternal.getString(helper
+											.getBundlePropertyName());
+								}
+							} catch (MissingResourceException exc) {
+								// Key wasn't found, ignore this.
+							}
+						}
+
+					} else if (null != bundleExternal) {
+						try {
+							label = bundleExternal.getString(helper
+									.getBundlePropertyName());
+						} catch (MissingResourceException exc) {
+							// Key wasn't found, ignore this.
+						}
+
 					}
+
 				}
 
 				if (label == null) {
 					label = helper.getDefaultText();
 				}
-				
+
 				writer.writeText(label, null);
 			}
 		}
@@ -379,7 +428,7 @@
 		// helper.getIdSuffix(), null);
 
 		// writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
-		
+
 		if (!useFacet) {
 			writer.endElement(HTML.DIV_ELEM);
 			if (!helper.enable) {
@@ -390,8 +439,9 @@
 		}
 		writer.endElement(HTML.DIV_ELEM);
 	}
-	
-	protected boolean isHeaderExists(FacesContext context, UIOrderingBaseComponent component, String facetName) {
+
+	protected boolean isHeaderExists(FacesContext context,
+			UIOrderingBaseComponent component, String facetName) {
 		Iterator headers = component.columns();
 		while (headers.hasNext()) {
 			UIComponent column = (UIComponent) headers.next();
@@ -402,64 +452,77 @@
 		}
 		return false;
 	}
-	
-	protected void encodeHeaderFacets(FacesContext context, ResponseWriter writer, 
-									  Iterator headers, String skinCellClass,
-									  String headerClass, String facetName, String element, UIOrderingBaseComponent orderingList
-									  )
-			throws IOException {
+
+	protected void encodeHeaderFacets(FacesContext context,
+			ResponseWriter writer, Iterator headers, String skinCellClass,
+			String headerClass, String facetName, String element,
+			UIOrderingBaseComponent orderingList) throws IOException {
 		while (headers.hasNext()) {
 			UIComponent column = (UIComponent) headers.next();
 			String classAttribute = facetName + "Class";
-			String columnHeaderClass = (String) column.getAttributes().get(classAttribute);
-			
+			String columnHeaderClass = (String) column.getAttributes().get(
+					classAttribute);
+
 			writer.startElement(element, column);
 			if (!headers.hasNext()) {
 				skinCellClass = skinCellClass + "-last";
 			}
-			encodeStyleClass(writer, null, skinCellClass, headerClass, columnHeaderClass);
+			encodeStyleClass(writer, null, skinCellClass, headerClass,
+					columnHeaderClass);
 			getUtils().encodeAttribute(context, column, "colspan");
 			writer.startElement("div", column);
-			writer.writeAttribute("style", "overflow:hidden;white-space: nowrap;", null);
-			String onHeaderClickEvent = (String) orderingList.getAttributes().get(ATTRIBUTE_CE_ONHEADERCLICK);
+			writer.writeAttribute("style",
+					"overflow:hidden;white-space: nowrap;", null);
+			String onHeaderClickEvent = (String) orderingList.getAttributes()
+					.get(ATTRIBUTE_CE_ONHEADERCLICK);
 			if (onHeaderClickEvent != null) {
-				writer.writeAttribute(HTML.onclick_ATTRIBUTE, onHeaderClickEvent, null);
+				writer.writeAttribute(HTML.onclick_ATTRIBUTE,
+						onHeaderClickEvent, null);
 			}
-			
+
 			UIComponent facet = column.getFacet(facetName);
 			if (facet != null && facet.isRendered()) {
 				renderChild(context, facet);
 			} else {
 				writer.write(" ");
 			}
-			
+
 			writer.endElement("div");
 			writer.endElement(element);
 		}
 	}
 
 	protected void encodeControlFacet(FacesContext context,
-			UIOrderingBaseComponent orderingList, OrderingComponentRendererBase.ControlsHelper helper,
-			String clientId, ResponseWriter writer, boolean enabled, String baseStyle, 
-			String baseControlStyle) throws IOException {
+			UIOrderingBaseComponent orderingList,
+			OrderingComponentRendererBase.ControlsHelper helper,
+			String clientId, ResponseWriter writer, boolean enabled,
+			String baseStyle, String baseControlStyle) throws IOException {
 		Locale locale = null;
-		
+
 		UIViewRoot viewRoot = context.getViewRoot();
 		if (viewRoot != null) {
 			locale = viewRoot.getLocale();
 		}
-		
-		ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
-		ResourceBundle bundle = null;
-		
+
+		ClassLoader contextClassLoader = Thread.currentThread()
+				.getContextClassLoader();
+		ResourceBundle bundleExternal = null;
+		ResourceBundle bundleApplication = null;
+		String messageBundle = context.getApplication().getMessageBundle();
 		if (locale != null) {
+			if (null != messageBundle) {
+				bundleApplication = ResourceBundle.getBundle(messageBundle,
+						locale, contextClassLoader);
+			}
+
 			try {
-				bundle = ResourceBundle.getBundle(bundleName, locale, contextClassLoader);
+				bundleExternal = ResourceBundle.getBundle(bundleName, locale,
+						contextClassLoader);
 			} catch (MissingResourceException e) {
-
+				// No external bundle was found, ignore this exception.
 			}
 		}
-		
+
 		Map attributes = orderingList.getAttributes();
 		UIComponent facet = orderingList.getFacet(helper.getFacetName());
 		boolean useFacet = (facet != null && facet.isRendered());
@@ -471,56 +534,64 @@
 			}
 		} else {
 			renderDefaultControl(context, orderingList, writer, useFacet,
-								 helper, clientId, bundle ,enabled, baseStyle, baseControlStyle);
+					helper, clientId, bundleExternal, bundleApplication,
+					enabled, baseStyle, baseControlStyle);
 		}
 	}
-	
+
 	public void encodeBegin(FacesContext context, UIComponent component)
 			throws IOException {
 		UIOrderingBaseComponent orderingComponent = (UIOrderingBaseComponent) component;
-		ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
-		variables.setVariable(ITEM_STATE_VAR_NAME, orderingComponent.getItemState());
-		
+		ComponentVariables variables = ComponentsVariableResolver.getVariables(
+				this, component);
+		variables.setVariable(ITEM_STATE_VAR_NAME, orderingComponent
+				.getItemState());
+
 		super.encodeBegin(context, component);
 	}
-	
-	protected ItemState getItemState(FacesContext context, UIComponent component, ComponentVariables variables)
+
+	protected ItemState getItemState(FacesContext context,
+			UIComponent component, ComponentVariables variables)
 			throws IOException {
 		return (ItemState) variables.getVariable(ITEM_STATE_VAR_NAME);
 	}
 
-	protected Converter getConverter(FacesContext context, UIOrderingBaseComponent component) {
+	protected Converter getConverter(FacesContext context,
+			UIOrderingBaseComponent component) {
 		Converter converter = component.getConverter();
 
 		if (converter == null) {
 			converter = component.getConverterForValue(context);
 		}
-		
+
 		if (converter == null) {
 			converter = DEFAULT_CONVERTER;
 		}
-		
+
 		return converter;
 	}
-	
+
 	public String getCaptionDisplay(FacesContext context, UIComponent component) {
-		Object caption = component.getAttributes().get(OrderingComponentControlsHelper.ATTRIBUTE_CAPTION_LABEL);
-		UIComponent facet = component.getFacet(OrderingComponentControlsHelper.FACET_CAPTION);
-		
-		if ((null != caption && !"".equals(caption)) ||
-				(null != facet && facet.isRendered())) {
+		Object caption = component.getAttributes().get(
+				OrderingComponentControlsHelper.ATTRIBUTE_CAPTION_LABEL);
+		UIComponent facet = component
+				.getFacet(OrderingComponentControlsHelper.FACET_CAPTION);
+
+		if ((null != caption && !"".equals(caption))
+				|| (null != facet && facet.isRendered())) {
 			return "";
 		}
 		return "display: none;";
 	}
-	
-	public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
+
+	public String getAsEventHandler(FacesContext context,
+			UIComponent component, String attributeName) {
 		String event = (String) component.getAttributes().get(attributeName);
 		ScriptString result = JSReference.NULL;
-		
+
 		if (event != null) {
 			event = event.trim();
-		
+
 			if (event.length() != 0) {
 				JSFunctionDefinition function = new JSFunctionDefinition();
 				function.addParameter("event");
@@ -532,18 +603,24 @@
 
 		return ScriptUtils.toScript(result);
 	}
-	
-	public String getColumnClassesAsJSArray(FacesContext context, UIComponent component) {
-		return ScriptUtils.toScript(getClassesAsList(context, component, "columnClasses"));
+
+	public String getColumnClassesAsJSArray(FacesContext context,
+			UIComponent component) {
+		return ScriptUtils.toScript(getClassesAsList(context, component,
+				"columnClasses"));
 	}
-	
-	public String getRowClassesAsJSArray(FacesContext context, UIComponent component) {
-		return ScriptUtils.toScript(getClassesAsList(context, component, "rowClasses"));
+
+	public String getRowClassesAsJSArray(FacesContext context,
+			UIComponent component) {
+		return ScriptUtils.toScript(getClassesAsList(context, component,
+				"rowClasses"));
 	}
-	
-	protected List getClassesAsList(FacesContext context, UIComponent component, String attr) {
-		
-		String value = (String) ((UIDataAdaptor) component).getAttributes().get(attr);
+
+	protected List getClassesAsList(FacesContext context,
+			UIComponent component, String attr) {
+
+		String value = (String) ((UIDataAdaptor) component).getAttributes()
+				.get(attr);
 		if (value != null && (value.length() != 0)) {
 			return Arrays.asList(value.split(","));
 		}

Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java	2008-02-12 16:29:20 UTC (rev 6031)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java	2008-02-12 16:33:40 UTC (rev 6032)
@@ -34,7 +34,7 @@
 		super(MESSAGE_BUNDLE_NAME);
 	}
 
-	private static final String MESSAGE_BUNDLE_NAME = OrderingListRendererBase.class.getPackage().getName() + "OrderingList";
+	private static final String MESSAGE_BUNDLE_NAME = OrderingListRendererBase.class.getPackage().getName() + ".orderingList";
 
 	private final static Character ACTIVITY_MARKER = new Character('a');
 	




More information about the richfaces-svn-commits mailing list