You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by id...@apache.org on 2009/02/04 16:21:11 UTC
svn commit: r740766 - in /myfaces/tobago/branches/tobago-1.0.x/core/src:
main/java/org/apache/myfaces/tobago/util/LayoutUtil.java
test/java/org/apache/myfaces/tobago/util/LayoutUtilTest.java
Author: idus
Date: Wed Feb 4 15:21:09 2009
New Revision: 740766
URL: http://svn.apache.org/viewvc?rev=740766&view=rev
Log:
cosmetics
Modified:
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java
myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/util/LayoutUtilTest.java
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java?rev=740766&r1=740765&r2=740766&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java Wed Feb 4 15:21:09 2009
@@ -109,7 +109,7 @@
}
} catch (Exception e) {
if (LOG.isDebugEnabled()) {
- LOG.debug("cant find margin", e);
+ LOG.debug("cannot find margin", e);
}
}
} else {
@@ -138,12 +138,12 @@
return 0;
}
- //TODO Change this to DimensionUtils.getWidth?
+ // TODO Change this to DimensionUtils.getWidth?
public static Integer getLayoutWidth(UIComponent component) {
return getLayoutSpace(component, ATTR_WIDTH, ATTR_LAYOUT_WIDTH);
}
- //TODO Change this to DimensionUtils.getHeight?
+ // TODO Change this to DimensionUtils.getHeight?
public static Integer getLayoutHeight(UIComponent component) {
return getLayoutSpace(component, ATTR_HEIGHT, ATTR_LAYOUT_HEIGHT);
}
@@ -153,12 +153,11 @@
Object value = ComponentUtil.getAttribute(component, sizeAttribute);
if (value != null) {
if (value instanceof String) {
- return new Integer(stripNonNumericChars(((String) value)));
+ return new Integer(stripNonNumericChars((String) value));
} else {
return (Integer) value;
}
} else if (!ComponentUtil.getBooleanAttribute(component, ATTR_INLINE)) {
-
value = ComponentUtil.getAttribute(component, layoutAttribute);
return (Integer) value;
}
@@ -179,8 +178,8 @@
public static boolean isTransparentForLayout(UIComponent component) {
-// SubViewTag's component is UINamingContainer with 'null' rendererType
-// is transparent for layouting
+ // SubViewTag's component is UINamingContainer with 'null' rendererType
+ // is transparent for layouting
if (component instanceof UINamingContainer
&& component.getRendererType() == null) {
@@ -194,7 +193,7 @@
if (component.getClass().getPackage().getName().equals("com.sun.facelets.compiler")) {
return true;
} */
-// also Forms are transparent for layouting
+ // also Forms are transparent for layouting
return component instanceof UIForm;
}
@@ -252,8 +251,7 @@
public static Dimension getMinimumSize(
FacesContext facesContext, UIComponent component) {
- Dimension dimension
- = (Dimension) component.getAttributes().get(ATTR_MINIMUM_SIZE);
+ Dimension dimension = (Dimension) component.getAttributes().get(ATTR_MINIMUM_SIZE);
if (dimension == null) {
LayoutInformationProvider renderer = ComponentUtil.getRenderer(facesContext, component);
if (renderer != null) {
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/util/LayoutUtilTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/util/LayoutUtilTest.java?rev=740766&r1=740765&r2=740766&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/util/LayoutUtilTest.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/util/LayoutUtilTest.java Wed Feb 4 15:21:09 2009
@@ -23,6 +23,8 @@
}
public void testStripNonNumericChars() {
+ assertEquals(null, LayoutUtil.stripNonNumericChars(null));
+ assertEquals("", LayoutUtil.stripNonNumericChars(""));
assertEquals("1", LayoutUtil.stripNonNumericChars("1px"));
assertEquals("99", LayoutUtil.stripNonNumericChars("99px"));
assertEquals("50", LayoutUtil.stripNonNumericChars("50%"));