I will try to explain:
I have the below build step code.
public class MyPluginBuilder extends Builder {
private final List<MyFlow> myFlows;
...............
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
{
for (MyFlow currentFlow : this.myFlows) {
}
return true;
}
@Override
public DescriptorImpl getDescriptor() {
return (DescriptorImpl) super.getDescriptor();
}
@Extension
public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {
private String localUrls;
public String getDisplayName() {
return "My Flows";
}
public ListBoxModel getLocalUrlsList(String value) {
ListBoxModel listModel = new ListBoxModel();
for (String currentUrl : localUrls.split("\n")) {
listModel.add(new Option(currentUrl, currentUrl, currentUrl.equals(value)));
}
return listModel;
}
}
}
And I have MyFlow class definition as below
public abstract class MyFlow extends AbstractDescribableImpl<MyFlow>
{
public abstract static class MyFlowDescriptor extends Descriptor<MyFlow>
{
public MyFlowDescriptor()
{
load();
}
}
}
In MyFlow config.jelly I need to have dropdown list with the values from getLocalUrlsList method of MyPluginBuilder class.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
<f:entry field="url" title="Urls">
<f:select />
</f:entry>
</j:jelly>
So, I try to find the way how I can fill the dropdown list based on getLocalUrlsList.