提交 0e79d59a 编写于 作者: I imod

use drop down selector to save space in the UI

TODO: remove old selectors
上级 d98b2d0f
......@@ -10,6 +10,8 @@ import java.io.IOException;
import javax.servlet.ServletException;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
/**
......@@ -23,14 +25,14 @@ public abstract class GlobalSettingsProvider extends AbstractDescribableImpl<Glo
* @param margs
* @param project
*/
public abstract void configure(ArgumentListBuilder margs, AbstractBuild project) throws IOException, InterruptedException;
public abstract void configure(ArgumentListBuilder margs, AbstractBuild<?, ?> project) throws IOException, InterruptedException;
public static GlobalSettingsProvider parseSettingsProvider(StaplerRequest req) throws Descriptor.FormException, ServletException {
String scm = req.getParameter("globalSettings");
if(scm==null) {
JSONObject settings = req.getSubmittedForm().getJSONObject("globalSettings");
if(settings==null) {
return new DefaultGlobalSettingsProvider();
}
return req.bindJSON(GlobalSettingsProvider.class, req.getSubmittedForm().getJSONObject("globalSettings"));
return req.bindJSON(GlobalSettingsProvider.class, settings);
}
}
......
......@@ -10,6 +10,8 @@ import java.io.IOException;
import javax.servlet.ServletException;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
/**
......@@ -23,14 +25,14 @@ public abstract class SettingsProvider extends AbstractDescribableImpl<SettingsP
* @param margs
* @param project
*/
public abstract void configure(ArgumentListBuilder margs, AbstractBuild project) throws IOException, InterruptedException;
public abstract void configure(ArgumentListBuilder margs, AbstractBuild<?, ?> project) throws IOException, InterruptedException;
public static SettingsProvider parseSettingsProvider(StaplerRequest req) throws Descriptor.FormException, ServletException {
String scm = req.getParameter("settings");
if(scm==null) {
JSONObject settings = req.getSubmittedForm().getJSONObject("settings");
if(settings==null) {
return new DefaultSettingsProvider();
}
return req.bindJSON(SettingsProvider.class, req.getSubmittedForm().getJSONObject("settings"));
return req.bindJSON(SettingsProvider.class, settings);
}
}
......
......@@ -79,16 +79,7 @@ THE SOFTWARE.
<f:entry title="MAVEN_OPTS" help="/plugin/maven-plugin/maven-opts.html">
<f:expandableTextbox name="mavenOpts" value="${it.mavenOpts}" />
</f:entry>
<f:entry title="${%Settings file}">
<f:hetero-radio field="settings" descriptors="${descriptor.settingsProviders}"/>
</f:entry>
<f:entry title="${%Global Settings file}">
<f:hetero-radio field="globalSettings" descriptors="${descriptor.globalSettingsProviders}"/>
</f:entry>
<f:optionalBlock name="maven.incrementalBuild"
title="${%Incremental build - only build changed modules}"
help="/plugin/maven-plugin/incremental.html"
......@@ -122,8 +113,9 @@ THE SOFTWARE.
</select>
</f:entry>
<!-- TODO remove after refactor start -->
<j:set var="mavenSettingsConfigs" value="${it.allMavenSettingsConfigs}" />
<f:entry title="${%Maven Settings Configs}">
<f:entry title="REMOVE - ${%Maven Settings Configs}">
<select class="setting-input" name="maven.mavenSettingsConfigId">
<f:option value="">- select -</f:option>
<j:forEach var="settingConfig" items="${mavenSettingsConfigs}">
......@@ -133,7 +125,7 @@ THE SOFTWARE.
</f:entry>
<j:set var="mavenGlobalSettingsConfigs" value="${it.allGlobalMavenSettingsConfigs}" />
<f:entry title="${%Maven Global Settings Configs}">
<f:entry title="REMOVE - ${%Maven Global Settings Configs}">
<select class="setting-input" name="maven.mavenGlobalSettingConfigId">
<f:option value="">- select -</f:option>
<j:forEach var="globalSettingConfig" items="${mavenGlobalSettingsConfigs}">
......@@ -141,6 +133,15 @@ THE SOFTWARE.
</j:forEach>
</select>
</f:entry>
<!-- TODO remove ende -->
<f:entry title="${%Settings file}">
<f:dropdownDescriptorSelector field="settings" descriptors="${descriptor.settingsProviders}"/>
</f:entry>
<f:entry title="${%Global Settings file}">
<f:dropdownDescriptorSelector field="globalSettings" descriptors="${descriptor.globalSettingsProviders}"/>
</f:entry>
</f:advanced>
</f:section>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册