aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-21 10:08:00 (EST)
committerWinston Prakash2011-12-01 20:46:53 (EST)
commit0c754001cbbad383b74e9498ab3b245af854f075 (patch)
treec594051bad757e84a95926c10c1db146700e2c4e
parentae4d34e02c10b161066aa24441b444a143025493 (diff)
downloadorg.eclipse.hudson.core-0c754001cbbad383b74e9498ab3b245af854f075.zip
org.eclipse.hudson.core-0c754001cbbad383b74e9498ab3b245af854f075.tar.gz
org.eclipse.hudson.core-0c754001cbbad383b74e9498ab3b245af854f075.tar.bz2
Improve optionalBlock tag. Add default css for <td> element. Improve UI:Mark field as changed only if project has templateParent value
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/model/JDK.java6
-rw-r--r--hudson-core/src/main/java/hudson/model/Job.java2
-rw-r--r--hudson-core/src/main/resources/lib/form/optionalBlock.jelly2
-rw-r--r--hudson-core/src/main/resources/lib/hudson/project/config-blockWhenDownstreamBuilding.jelly2
-rw-r--r--hudson-core/src/main/resources/lib/hudson/project/config-blockWhenUpstreamBuilding.jelly2
-rw-r--r--hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly2
6 files changed, 9 insertions, 7 deletions
diff --git a/hudson-core/src/main/java/hudson/model/JDK.java b/hudson-core/src/main/java/hudson/model/JDK.java
index 8ddac92..def3180 100644
--- a/hudson-core/src/main/java/hudson/model/JDK.java
+++ b/hudson-core/src/main/java/hudson/model/JDK.java
@@ -134,12 +134,14 @@ public final class JDK extends ToolInstallation implements NodeSpecific<JDK>, En
return "JDK"; // XXX I18N
}
- public @Override JDK[] getInstallations() {
+ @Override
+ public JDK[] getInstallations() {
return Hudson.getInstance().getJDKs().toArray(new JDK[0]);
}
// this isn't really synchronized well since the list is Hudson.jdks :(
- public @Override synchronized void setInstallations(JDK... jdks) {
+ @Override
+ public synchronized void setInstallations(JDK... jdks) {
List<JDK> list = Hudson.getInstance().getJDKs();
list.clear();
list.addAll(Arrays.asList(jdks));
diff --git a/hudson-core/src/main/java/hudson/model/Job.java b/hudson-core/src/main/java/hudson/model/Job.java
index a8478e9..4c03128 100644
--- a/hudson-core/src/main/java/hudson/model/Job.java
+++ b/hudson-core/src/main/java/hudson/model/Job.java
@@ -1272,7 +1272,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
* Checks whether current job is inherited from other project.
* @return boolean.
*/
- protected boolean hasParentTemplate() {
+ public boolean hasParentTemplate() {
return null != getTemplate();
}
diff --git a/hudson-core/src/main/resources/lib/form/optionalBlock.jelly b/hudson-core/src/main/resources/lib/form/optionalBlock.jelly
index 99684c4..9b3cefc 100644
--- a/hudson-core/src/main/resources/lib/form/optionalBlock.jelly
+++ b/hudson-core/src/main/resources/lib/form/optionalBlock.jelly
@@ -58,7 +58,7 @@
</j:if>
<tr class="optional-block-start ${attrs.inline?'':'row-set-start'}" hasHelp="${attrs.help!=null}"><!-- this ID marks the beginning -->
- <td colspan="3" class="${attrs.isTemplateValue? 'modified': ''}">
+ <td colspan="3" class="${attrs.isTemplateValue? 'modified': 'original'}">
<f:checkbox name="${attrs.name}" onclick="javascript:updateOptionalBlock(this,true)"
negative="${attrs.negative}" checked="${attrs.checked}" field="${attrs.field}" title="${title}" />
</td>
diff --git a/hudson-core/src/main/resources/lib/hudson/project/config-blockWhenDownstreamBuilding.jelly b/hudson-core/src/main/resources/lib/hudson/project/config-blockWhenDownstreamBuilding.jelly
index e0c7e6b..de2a7e9 100644
--- a/hudson-core/src/main/resources/lib/hudson/project/config-blockWhenDownstreamBuilding.jelly
+++ b/hudson-core/src/main/resources/lib/hudson/project/config-blockWhenDownstreamBuilding.jelly
@@ -21,5 +21,5 @@
title="${%Block build when downstream project is building}"
help="/help/project-config/block-downstream-building.html"
checked="${it.blockBuildWhenDownstreamBuilding()}"
- isTemplateValue="${null != it.blockBuildWhenDownstreamBuilding(false)}"/>
+ isTemplateValue="${it.hasParentTemplate() and null != it.blockBuildWhenDownstreamBuilding(false)}"/>
</j:jelly>
diff --git a/hudson-core/src/main/resources/lib/hudson/project/config-blockWhenUpstreamBuilding.jelly b/hudson-core/src/main/resources/lib/hudson/project/config-blockWhenUpstreamBuilding.jelly
index cc863fa..dea9128 100644
--- a/hudson-core/src/main/resources/lib/hudson/project/config-blockWhenUpstreamBuilding.jelly
+++ b/hudson-core/src/main/resources/lib/hudson/project/config-blockWhenUpstreamBuilding.jelly
@@ -21,5 +21,5 @@
title="${%Block build when upstream project is building}"
help="/help/project-config/block-upstream-building.html"
checked="${it.blockBuildWhenUpstreamBuilding()}"
- isTemplateValue="${null != it.blockBuildWhenUpstreamBuilding(false)}"/>
+ isTemplateValue="${it.hasParentTemplate() and null != it.blockBuildWhenUpstreamBuilding(false)}"/>
</j:jelly>
diff --git a/hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly b/hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly
index 0090ede..b34d56b 100644
--- a/hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly
+++ b/hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly
@@ -19,6 +19,6 @@
<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">
<f:optionalBlock name="cleanWorkspaceRequired" title="${%Clean workspace before build}"
checked="${it.cleanWorkspaceRequired}"
- isTemplateValue="${null != it.cleanWorkspaceRequired(false)}"
+ isTemplateValue="${it.hasParentTemplate() and null != it.isCleanWorkspaceRequired(false)}"
help="/help/project-config/cleanWorkspace.html" />
</j:jelly>