choosing the default values bit more wisely

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4569 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-09-01 14:33:10 +00:00
1 parent 54988bd608
commit ca6f4c389f
3 files changed
+12 -2

No files matched your search

+10
View File
@@ -608,4 +608,14 @@ public class Functions {
public static String getResourcePath() {
return Hudson.RESOURCE_PATH;
}
/**
* Can be used to check a checkbox by default.
* Used from views like {@code h.defaultToTrue(scm.useUpdate)}.
* The expression will evaluate to true if scm is null.
*/
public static boolean defaultToTrue(Boolean b) {
if(b==null) return true;
return b;
}
}