[Tynstep-svn] r162 - in trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework: . utils
ChrisBurrell at crosswire.org
ChrisBurrell at crosswire.org
Sat Jul 31 02:28:03 MST 2010
Author: ChrisBurrell
Date: 2010-07-31 02:28:03 -0700 (Sat, 31 Jul 2010)
New Revision: 162
Added:
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/DecoratorUtils.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/StringUtils.java
Log:
commiting fix to remove unecessary compile files causing assembler to overwrite gwtp compilation
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/DecoratorUtils.java (from rev 150, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/DecoratorUtils.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/DecoratorUtils.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/DecoratorUtils.java 2010-07-31 09:28:03 UTC (rev 162)
@@ -0,0 +1,37 @@
+package com.tyndalehouse.step.web.client.framework.utils;
+
+import static java.lang.Integer.valueOf;
+
+public class DecoratorUtils {
+ /** The string representation of a pixel */
+ private static final String PIXEL_UNIT = "px";
+ /** default padding to assign */
+ private final static int DECORATOR_PADDING = 10;
+
+ /**
+ * hiding implementation
+ */
+ private DecoratorUtils() {
+ }
+
+ /**
+ * removes the last part of the dimension and adjusts
+ *
+ * @param dimension
+ * dimension to be adjusted for padding
+ * @return the new dimension
+ */
+ public static String removePadding(final String dimension) {
+ if (dimension.endsWith(PIXEL_UNIT)) {
+ final int dim = valueOf(dimension.substring(0, dimension.length() - 2));
+ return String.valueOf(dim - DECORATOR_PADDING) + PIXEL_UNIT;
+ }
+ return dimension;
+ }
+
+ /** removes padding based on a double **/
+ public static double removePadding(final double dimension) {
+ return dimension - DECORATOR_PADDING;
+ }
+
+}
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/StringUtils.java (from rev 150, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/common/StringUtils.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/StringUtils.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/utils/StringUtils.java 2010-07-31 09:28:03 UTC (rev 162)
@@ -0,0 +1,29 @@
+package com.tyndalehouse.step.web.client.framework.utils;
+
+public class StringUtils {
+ /**
+ * hiding implementation
+ */
+ private StringUtils() {
+ // no implementation
+ }
+
+ /**
+ * @param s
+ * the string to evaluate
+ * @return true if s == null or s.length == 0
+ */
+ public static boolean isEmpty(final String s) {
+ return s == null || s.length() == 0;
+ }
+
+ /**
+ * @param s
+ * the string to evaluate
+ * @return true if !(s == null or s.length == 0)
+ */
+ public static boolean isNotEmpty(final String s) {
+ return !isEmpty(s);
+ }
+
+}
More information about the Tynstep-svn
mailing list