]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/forms/FormUtils.java
Merge security.ui bundle in the cms.ui.workbench bundle
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / forms / FormUtils.java
index 400aa735c273ebaca5a9cfa78f8b7574ebf76def..f8d08b08d8a418299e75fc553a2f520c411ad511 100644 (file)
@@ -11,9 +11,10 @@ import javax.jcr.RepositoryException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.ArgeoException;
+import org.argeo.cms.CmsException;
 import org.argeo.cms.CmsView;
 import org.argeo.cms.util.CmsUtils;
+import org.argeo.eclipse.ui.EclipseUiUtils;
 import org.eclipse.jface.fieldassist.ControlDecoration;
 import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
 import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -32,15 +33,10 @@ public class FormUtils {
 
        public final static String DEFAULT_SHORT_DATE_FORMAT = "dd/MM/yyyy";
 
-       /** Simply checks if a string is not null nor empty */
-       public static boolean notEmpty(String stringToTest) {
-               return stringToTest == null || "".equals(stringToTest.trim());
-       }
-
        /** Best effort to convert a String to a calendar. Fails silently */
        public static Calendar parseDate(DateFormat dateFormat, String calStr) {
                Calendar cal = null;
-               if (notEmpty(calStr)) {
+               if (EclipseUiUtils.notEmpty(calStr)) {
                        try {
                                Date date = dateFormat.parse(calStr);
                                cal = new GregorianCalendar();
@@ -66,7 +62,7 @@ public class FormUtils {
                                try {
                                        cmsView.navigateTo(node.getPath());
                                } catch (RepositoryException e) {
-                                       throw new ArgeoException("Unable to get path for node "
+                                       throw new CmsException("Unable to get path for node "
                                                        + node + " before calling navigateTo(path)", e);
                                }
                        }