提交 79c07e35 编写于 作者: K kohsuke

adding transient action support.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6673 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a682b291
......@@ -273,6 +273,12 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node,
public transient final ServletContext servletContext;
/**
* Transient action list. Useful for adding navigation items to the navigation bar
* on the left.
*/
private transient final List<Action> actions = new CopyOnWriteArrayList<Action>();
public static Hudson getInstance() {
return theInstance;
}
......@@ -542,6 +548,26 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node,
return "";
}
/**
* Returns the transient {@link Action}s associated with the top page.
*
* <p>
* Adding {@link Action} is primarily useful for plugins to contribute
* an item to the navigation bar of the top page. See existing {@link Action}
* implementation for it affects the GUI.
*
* <p>
* To register an {@link Action}, write code like
* {@code Hudson.getInstance().getActions().add(...)}
*
* @return
* Live list where the changes can be made. Can be empty but never null.
* @since 1.172
*/
public List<Action> getActions() {
return actions;
}
/**
* Gets just the immediate children of {@link Hudson}.
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册