Skip to content

Commit

Permalink
[FIXED JENKINS-28094] Removed ca:selectorList.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikedam committed Apr 25, 2015
1 parent 11705ee commit 6ad2f22
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 77 deletions.
Expand Up @@ -23,6 +23,9 @@
*/
package hudson.plugins.copyartifact;

import java.util.List;

import jenkins.model.Jenkins;
import hudson.DescriptorExtensionList;
import hudson.Extension;
import hudson.model.Descriptor;
Expand All @@ -35,6 +38,10 @@
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;

import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;

/**
* @author Alan Harder
*/
Expand Down Expand Up @@ -90,6 +97,20 @@ public String getDisplayName() {
public DescriptorExtensionList<BuildSelector,Descriptor<BuildSelector>> getBuildSelectors() {
return Hudson.getInstance().<BuildSelector,Descriptor<BuildSelector>>getDescriptorList(BuildSelector.class);
}

/**
* @return {@link BuildSelector}s available for BuildSelectorParameter.
*/
public List<Descriptor<BuildSelector>> getAvailableBuildSelectorList() {
return Lists.newArrayList(Collections2.filter(
Jenkins.getInstance().getDescriptorList(BuildSelector.class),
new Predicate<Descriptor<BuildSelector>>() {
public boolean apply(Descriptor<BuildSelector> input) {
return !"ParameterizedBuildSelector".equals(input.clazz.getSimpleName());
};
}
));
}
}

private static final XStream2 XSTREAM = new XStream2();
Expand Down
Expand Up @@ -22,12 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:ca="/hudson/plugins/copyartifact">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
<f:entry title="${%Name}" field="name" help="/help/parameter/name.html">
<f:textbox/>
</f:entry>
<ca:selectorList currentSelector="${instance.defaultSelector}"
name="defaultSelector" title="${%Default Selector}" omit="ParameterizedBuildSelector"/>
<f:dropdownDescriptorSelector field="defaultSelector" help="/plugin/copyartifact/help-buildSelector.html"
title="${%Default Selector}" descriptors="${descriptor.availableBuildSelectorList}" />
<f:entry title="${%Description}" field="description" help="/help/parameter/description.html">
<f:textarea/>
</f:entry>
Expand Down
Expand Up @@ -22,10 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:ca="/hudson/plugins/copyartifact">
<ca:selectorList currentSelector="${it.defaultSelector}" descriptor="${it.descriptor}"
name="parameter" title="${it.name}" description="${it.description}"
omit="ParameterizedBuildSelector">
<tr><td><input type="hidden" name="name" value="${it.name}"/></td></tr>
</ca:selectorList>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
<f:dropdownDescriptorSelector field="parameter" help="/plugin/copyartifact/help-buildSelector.html"
title="${it.name}" description="${it.description}"
default="${it.defaultSelector}"
descriptors="${it.descriptor.availableBuildSelectorList}">
<j:if test="${dropdownListMode=='generateEntries'}">
<tr><td><input type="hidden" name="name" value="${it.name}"/></td></tr>
</j:if>
</f:dropdownDescriptorSelector>
</j:jelly>
Expand Up @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:ca="/hudson/plugins/copyartifact">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
<f:entry title="${%Project name}" field="projectName">
<f:editableComboBox items="${app.topLevelItemNames}" clazz="setting-input"/>
</f:entry>
Expand Down
67 changes: 0 additions & 67 deletions src/main/resources/hudson/plugins/copyartifact/selectorList.jelly

This file was deleted.

Empty file.

0 comments on commit 6ad2f22

Please sign in to comment.