Guest User

Untitled

a guest
May 27th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. public class LogInfoBuilder extends Builder {
  2. private final TimerSettings settings = new TimerSettings();
  3.  
  4. private final List<String> infoCollection = new ArrayList<String>();
  5.  
  6. // Fields in config.jelly must match the parameter names in the "DataBoundConstructor"
  7. @DataBoundConstructor
  8. public LogInfoBuilder(String key, boolean isStart) {
  9. settings.setKey(key);
  10. settings.setIsStart(isStart);
  11. }
  12.  
  13. /**
  14. * We'll use this from the <tt>config.jelly</tt>.
  15. */
  16. public String getKey() {
  17. return settings.getKey();
  18. }
  19.  
  20. public boolean isStart()
  21. {
  22. return settings.getIsStart();
  23. }
  24.  
  25. ...
  26.  
  27. <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
  28. <!--
  29. This jelly script is used for per-project configuration.
  30.  
  31. See global.jelly for a general discussion about jelly script.
  32. -->
  33.  
  34. <!--
  35. Creates a text field that shows the value of the "name" property.
  36. When submitted, it will be passed to the corresponding constructor parameter.
  37. -->
  38. <f:entry title="Key" field="key">
  39. <f:textbox />
  40. </f:entry>
  41.  
  42. <!--
  43. <f:entry title="Start?" field="isstart">
  44. <select name="isStart">
  45. <option value="true" selected="${it.isstart}">Yes</option>
  46. <option value="false" selected="${!it.isstart}">No!</option>
  47. </select>
  48. </f:entry>
  49. -->
  50.  
  51. <f:entry title="Starting point?" description="If checked, this will be the starting point.">
  52. <f:checkbox name="start" checked="${it.start}"/>
  53. </f:entry>
  54. </j:jelly>
  55.  
  56. <f:entry title="Start?" field="isstart">
  57. <select name="isStart">
  58. <option value="true" selected="${it.isstart}">Yes</option>
  59. <option value="false" selected="${!it.isstart}">No!</option>
  60. </select>
  61. </f:entry>
  62.  
  63. <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
  64. <!--
  65. This jelly script is used for per-project configuration.
  66.  
  67. See global.jelly for a general discussion about jelly script.
  68. -->
  69.  
  70. <!--
  71. Creates a text field that shows the value of the "name" property.
  72. When submitted, it will be passed to the corresponding constructor parameter.
  73. -->
  74. <f:entry title="Key" field="key">
  75. <f:textbox />
  76. </f:entry>
  77.  
  78. <f:entry title="Starting point?" field="start" description="If checked, this will be the starting point.">
  79. <f:checkbox/>
  80. </f:entry>
  81. </j:jelly>
  82.  
  83. public class LogInfoBuilder extends Builder {
  84. private final TimerSettings settings = new TimerSettings();
  85.  
  86. private final List<String> infoCollection = new ArrayList<String>();
  87.  
  88. // Fields in config.jelly must match the parameter names in the "DataBoundConstructor"
  89. @DataBoundConstructor
  90. public LogInfoBuilder(String key, boolean start) {
  91. settings.setKey(key);
  92. settings.setIsStart(start);
  93. }
  94.  
  95. /**
  96. * We'll use this from the <tt>config.jelly</tt>.
  97. */
  98. public String getKey() {
  99. return settings.getKey();
  100. }
  101.  
  102. public boolean isStart()
  103. {
  104. return settings.getIsStart();
  105. }
  106.  
  107. ...
  108.  
  109. <f:entry title="Starting point?" description="...">
  110. <f:checkbox field="start" />
  111. </f:entry>
  112.  
  113. or
  114. <f:entry title="Starting point?" field="start" description="...">
  115. <f:checkbox />
  116. </f:entry>
Add Comment
Please, Sign In to add comment