mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-30 13:05:19 +00:00
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:
1 parent
54988bd608
commit
ca6f4c389f
3 files changed
+12
-2
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user