提交 cd6c126f 编写于 作者: K kohsuke

BuildWrapper now has the getProjectAction method.

See http://www.nabble.com/Plugin-development-help-tt17870443.html

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10144 71c3de6d-444a-0410-be80-ed276b4c234a
上级 d3e6c65a
......@@ -112,6 +112,11 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
if(a!=null)
transientActions.add(a);
}
for (BuildWrapper step : buildWrappers) {
Action a = step.getProjectAction(this);
if(a!=null)
transientActions.add(a);
}
for (Trigger trigger : triggers) {
Action a = trigger.getProjectAction();
if(a!=null)
......
......@@ -166,6 +166,11 @@ public abstract class Project<P extends Project<P,B>,B extends Build<P,B>>
if(a!=null)
transientActions.add(a);
}
for (BuildWrapper step : buildWrappers) {
Action a = step.getProjectAction(this);
if(a!=null)
transientActions.add(a);
}
for (Trigger trigger : triggers) {
Action a = trigger.getProjectAction();
if(a!=null)
......
......@@ -7,6 +7,8 @@ import hudson.model.Build;
import hudson.model.BuildListener;
import hudson.model.Describable;
import hudson.model.Project;
import hudson.model.Action;
import hudson.model.AbstractProject;
import java.io.IOException;
import java.util.Map;
......@@ -133,4 +135,17 @@ public abstract class BuildWrapper implements ExtensionPoint, Describable<BuildW
public Environment setUp( Build build, Launcher launcher, BuildListener listener ) throws IOException, InterruptedException {
throw new UnsupportedOperationException(getClass()+" needs to implement the setUp method");
}
/**
* {@link Action} to be displayed in the job page.
*
* @param job
* This object owns the {@link BuildWrapper}. The returned action will be added to this object.
* @return
* null if there's no such action.
* @since 1.226
*/
public Action getProjectAction(AbstractProject job) {
return null;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册