Package jenkins.model.dashboard
Class ItemListTab
java.lang.Object
jenkins.model.Tab
jenkins.model.dashboard.ItemListTab
- All Implemented Interfaces:
Action,ModelObject,Badgeable
- Direct Known Subclasses:
AllTab
@Restricted(org.kohsuke.accmod.restrictions.Beta.class)
public abstract class ItemListTab
extends Tab
A
Dashboard tab that lists items, loading them a page at a time as the user scrolls,
with a search box.
Subclasses only provide the items. For example, a tab listing the current user's favourite jobs:
public class FavoritesTab extends ItemListTab {
public FavoritesTab(Dashboard dashboard) { super(dashboard); }
public String getDisplayName() { return "Favorites"; }
public String getIconFileName() { return "symbol-star"; }
public String getUrlName() { return "favorites"; }
public Iterable<? extends Item> getItems() { return Favorites.getFavorites(User.current()); }
}
and contribute it with a TransientActionFactory for Dashboard.- Since:
- TODO
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoItems(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String start, String after, String search) Renders one page of rows as an HTML fragment.Shown when there is nothing to list and no search is active.The page shown when there is nothing to list: the welcome page of the root of Jenkins, whichever view is the primary one.getItems()The items to list, in display order, already filtered to those the current user can see.Reads one page of items, by position only.Reads one page of items.Accepts items whose name or full display name contains a query, ignoring case.The items matching a search query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Action
getDescription, getDisplayName, getEvent, getGroup, getIconFileName, getSemantic, getUrlName, isVisibleInContextMenu
-
Constructor Details
-
ItemListTab
-
-
Method Details
-
getItems
The items to list, in display order, already filtered to those the current user can see. Only the requested page is read from the returnedIterable, so it may be lazy. -
search
The items matching a search query. By default, the items fromgetItems()accepted bymatching(String).- Parameters:
query- a non-blank query
-
matching
Accepts items whose name or full display name contains a query, ignoring case. The full display name includes the names of the folders containing the item, so a folder's name matches everything in it. -
getEmptyMessage
Shown when there is nothing to list and no search is active. -
getPage
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public ItemListTab.Page getPage(int start, @CheckForNull String after, @CheckForNull String search) Reads one page of items. Items the current user cannot read are left out, whatever the subclass returns.- Parameters:
start- the index of the first item to return, used whenafteris not listedafter- the full name of the last item already shown, ornull. The page continues after it, so items removed from earlier in the list don't shift the page past items not yet shown.search- a query, ornullto list everything
-
getPage
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public ItemListTab.Page getPage(int start, @CheckForNull String search) Reads one page of items, by position only.- See Also:
-
getEmptyStateView
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public View getEmptyStateView()The page shown when there is nothing to list: the welcome page of the root of Jenkins, whichever view is the primary one. -
doItems
@GET @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doItems(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String start, @QueryParameter String after, @QueryParameter String search) throws IOException, jakarta.servlet.ServletException Renders one page of rows as an HTML fragment.- Throws:
IOExceptionjakarta.servlet.ServletException
-