You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2008/11/11 09:08:17 UTC
svn commit: r712979 -
/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java
Author: matzew
Date: Tue Nov 11 00:08:17 2008
New Revision: 712979
URL: http://svn.apache.org/viewvc?rev=712979&view=rev
Log:
TRINIDAD-1264 - In Mobile Devices - commandNavigationItem has alignment problems with its Text and icon
Thx to Mamallan Uthaman for the patch
Modified:
myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java
Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java?rev=712979&r1=712978&r2=712979&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java Tue Nov 11 00:08:17 2008
@@ -547,12 +547,12 @@
{
if ( (iconUri != null) && !isRtl )
{
- _appendIcon(context, rw, iconUri, isRtl);
+ _appendIcon(context, rw, iconUri, isRtl, arc);
}
- _writeItemLink(context, arc, rw, itemData, isDisabled);
+ _writeItemLink(context, arc, rw, itemData, isDisabled);
if ( (iconUri != null) && isRtl )
{
- _appendIcon(context, rw, iconUri, isRtl);
+ _appendIcon(context, rw, iconUri, isRtl, arc);
}
}
@@ -560,20 +560,38 @@
FacesContext context,
ResponseWriter rw,
String iconUri,
- boolean isRtl
+ boolean isRtl,
+ RenderingContext arc
) throws IOException
{
+ String styleAppender = "";
rw.startElement("img", null);
rw.writeAttribute("border", "0", null);
rw.writeAttribute("align", "absmiddle", null);
- if (isRtl)
+
+ if (isPDA(arc))
{
- rw.writeAttribute("style", "padding-left: 5px; float: right;", null);
+ if (isRtl)
+ {
+ rw.writeAttribute("style", "padding-left: 5px;", null);
+ }
+ else
+ {
+ rw.writeAttribute("style", "padding-right: 5px;", null);
+ }
}
else
{
- rw.writeAttribute("style", "padding-right: 5px; float: left;", null);
+ if (isRtl)
+ {
+ rw.writeAttribute("style", "padding-left: 5px; float: right;", null);
+ }
+ else
+ {
+ rw.writeAttribute("style", "padding-right: 5px; float: left;", null);
+ }
}
+
Application application = context.getApplication();
ViewHandler handler = application.getViewHandler();
String resolvedIconUri = handler.getResourceURL(context, iconUri);