Package hudson.model
Class ListView
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.View
hudson.model.ListView
- All Implemented Interfaces:
ExtensionPoint,Describable<View>,DescriptorByNameOwner,DirectlyModifiableView,ModelObject,Saveable,SearchableModelObject,SearchItem,AccessControlled,ModelObjectWithChildren,HasWidgets
Displays
Jobs in a flat list view.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classNested classes/interfaces inherited from class hudson.model.View
View.PropertyListNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.View
CONFIGURE, CREATE, DELETE, description, filterExecutors, filterQueue, LIST, name, NEW_PRONOUN, owner, PERMISSIONS, READ, SORTER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(TopLevelItem item) Adds the given item to this view.booleancontains(TopLevelItem item) Checks if the job is in this collection.org.kohsuke.stapler.HttpResponsedoAddJobToView(String name) Handle addJobToView web method.doCreateItem(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Creates a newItemin this collection.org.kohsuke.stapler.HttpResponsedoRemoveJobFromView(String name) Handle removeJobFromView web method.If this view uses<t:projectView>for rendering, this method returns columns to be displayed.static List<ListViewColumn> Deprecated.getItems()Returns a read-only view of allJobs in this view.Deprecated.Status filter is now controlled via aViewJobFilter, seeStatusFilterbooleanUsed to determine if we want to display the Add button.protected voidprotected voidbooleanDetermines the initial state of the checkbox.booleanbooleanjobNamesContains(TopLevelItem item) Default implementation that returns empty index.protected Objectbooleanremove(TopLevelItem item) Removes given item from this view.voidsetColumns(List<ListViewColumn> columns) Sets the columns of this view.voidsetIncludeRegex(String includeRegex) voidsetJobFilters(List<ViewJobFilter> jobFilters) voidsetJobNames(Set<String> jobNames) voidsetRecurse(boolean recurse) voidsetStatusFilter(Boolean statusFilter) Deprecated.Status filter is now controlled via aViewJobFilter, seeStatusFilterprotected voidsubmit(org.kohsuke.stapler.StaplerRequest req) Deprecated.protected voidsubmit(org.kohsuke.stapler.StaplerRequest2 req) Handles the configuration submission.Methods inherited from class hudson.model.View
all, allInstantiable, create, create, createViewFromXML, doCheckJobName, doChildrenContextMenu, doConfigDotXml, doConfigDotXml, doConfigSubmit, doCreateItem, doDoDelete, doItemCategories, doRssAll, doRssFailed, doRssLatest, doSubmitDescription, doSubmitDescription, getAbsoluteUrl, getACL, getActions, getAllItems, getAllProperties, getApi, getApplicablePropertyDescriptors, getApproximateQueueItemsQuickly, getBuilds, getComputers, getDescription, getDescriptor, getDisplayName, getDynamic, getIndenter, getItem, getItemCreatePermission, getJob, getNewPronoun, getOwner, getOwnerItemGroup, getOwnerPrimaryView, getOwnerViewActions, getPostConstructLandingPage, getProperties, getQueueItems, getSearchGroup, getSearchIcon, getSearchUrl, getTimeline, getUrl, getViewName, getViewUrl, getVisiblePropertyDescriptors, isAutomaticRefreshEnabled, isDefault, isEditable, isFilterExecutors, isFilterQueue, makeSearchIndex, onJobRenamed, registerPermissions, rename, save, setDescription, setFilterExecutors, setFilterQueue, toString, updateByXml, updateTransientActions, writeXmlMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByNameMethods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgetsMethods inherited from interface jenkins.model.ModelObjectWithChildren
doChildrenContextMenu
-
Constructor Details
-
ListView
-
ListView
-
-
Method Details
-
setColumns
Sets the columns of this view.- Throws:
IOException
-
setJobFilters
- Throws:
IOException
-
readResolve
-
initColumns
protected void initColumns() -
initJobFilters
protected void initJobFilters() -
hasJobFilterExtensions
public boolean hasJobFilterExtensions()Used to determine if we want to display the Add button. -
getJobFilters
-
getColumns
Description copied from class:ViewIf this view uses<t:projectView>for rendering, this method returns columns to be displayed.- Overrides:
getColumnsin classView
-
getJobNames
-
getItems
Returns a read-only view of allJobs in this view.This method returns a separate copy each time to avoid concurrent modification issue.
-
makeSearchIndex
Description copied from class:AbstractModelObjectDefault implementation that returns empty index.- Overrides:
makeSearchIndexin classView
-
contains
Description copied from class:ViewChecks if the job is in this collection. -
jobNamesContains
-
add
Adds the given item to this view.- Specified by:
addin interfaceDirectlyModifiableView- Throws:
IOException- Adding failed.- Since:
- 1.389
-
remove
Removes given item from this view.- Specified by:
removein interfaceDirectlyModifiableView- Returns:
- false if item not present in view, true if removed.
- Throws:
IOException- Removal failed.- Since:
- 1.566
-
getIncludeRegex
-
isRecurse
public boolean isRecurse() -
setRecurse
@DataBoundSetter public void setRecurse(boolean recurse) - Since:
- 1.568
-
getStatusFilter
Deprecated.Status filter is now controlled via aViewJobFilter, seeStatusFilterFilter by enabled/disabled status of jobs. Null for no filter, true for enabled-only, false for disabled-only. -
isAddToCurrentView
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isAddToCurrentView()Determines the initial state of the checkbox.- Returns:
- true when the view is empty or already contains jobs specified by name.
-
doCreateItem
@POST public Item doCreateItem(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException Description copied from class:ViewCreates a newItemin this collection.This method should call
ModifiableItemGroup.doCreateItem(StaplerRequest2, StaplerResponse2)and then add the newly created item to this view.- Overrides:
doCreateItemin classView- Returns:
- null if fails.
- Throws:
IOExceptionjakarta.servlet.ServletException
-
doAddJobToView
public org.kohsuke.stapler.HttpResponse doAddJobToView(@QueryParameter String name) throws IOException, jakarta.servlet.ServletException Description copied from interface:DirectlyModifiableViewHandle addJobToView web method. This method shouldRequirePOST.- Specified by:
doAddJobToViewin interfaceDirectlyModifiableView- Parameters:
name- Item name. This can be either full name relative to owner item group or full item name prefixed with '/'.- Throws:
IOExceptionjakarta.servlet.ServletException
-
doRemoveJobFromView
public org.kohsuke.stapler.HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, jakarta.servlet.ServletException Description copied from interface:DirectlyModifiableViewHandle removeJobFromView web method. This method shouldRequirePOST.- Specified by:
doRemoveJobFromViewin interfaceDirectlyModifiableView- Parameters:
name- Item name. This can be either full name relative to owner item group or full item name prefixed with '/'.- Throws:
IOExceptionjakarta.servlet.ServletException
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest2 req) throws jakarta.servlet.ServletException, Descriptor.FormException, IOException Handles the configuration submission. Load view-specific properties here.- Overrides:
submitin classView- Throws:
jakarta.servlet.ServletExceptionDescriptor.FormExceptionIOException
-
submit
@Deprecated protected void submit(org.kohsuke.stapler.StaplerRequest req) throws javax.servlet.ServletException, Descriptor.FormException, IOException Deprecated.- Overrides:
submitin classView- Throws:
javax.servlet.ServletExceptionDescriptor.FormExceptionIOException
-
setIncludeRegex
- Since:
- 1.526
-
setJobNames
-
setStatusFilter
Deprecated.Status filter is now controlled via aViewJobFilter, seeStatusFilter -
getDefaultColumns
Deprecated.as of 1.391 UseListViewColumn.createDefaultInitialColumnList()
-
ListViewColumn.createDefaultInitialColumnList()