hudson.model
Class ListView

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.View
          extended by hudson.model.ListView
All Implemented Interfaces:
ExtensionPoint, Describable<View>, ModelObject, Saveable, SearchableModelObject, SearchItem, AccessControlled

public class ListView
extends View
implements Saveable

Displays Jobs in a flat list view.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class ListView.DescriptorImpl
           
 
Nested classes/interfaces inherited from class hudson.model.View
View.People, View.UserInfo
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.model.View
CONFIGURE, CREATE, DELETE, LIST, PERMISSIONS, SORTER
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
ListView(String name)
           
ListView(String name, ViewGroup owner)
           
 
Method Summary
 void add(TopLevelItem item)
          Adds the given item to this view.
 boolean contains(TopLevelItem item)
          Checks if the job is in this collection.
 Item doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Creates a new Item in this collection.
 Iterable<ListViewColumn> getColumns()
           
static List<ListViewColumn> getDefaultColumns()
          Deprecated. as of 1.391 Use ListViewColumn.createDefaultInitialColumnList()
 String getIncludeRegex()
           
 List<TopLevelItem> getItems()
          Returns a read-only view of all Jobs in this view.
 DescribableList<ViewJobFilter,Descriptor<ViewJobFilter>> getJobFilters()
           
 Boolean getStatusFilter()
          Filter by enabled/disabled status of jobs.
 boolean hasJobFilterExtensions()
          Used to determine if we want to display the Add button.
 void onJobRenamed(Item item, String oldName, String newName)
          Called when a job name is changed or deleted.
 void save()
          Persists the state of this object into XML.
 
Methods inherited from class hudson.model.View
all, checkPermission, create, doConfigSubmit, doDoDelete, doRssAll, doRssFailed, doRssLatest, doSubmitDescription, getAbsoluteUrl, getACL, getActions, getApi, getBuilds, getComputers, getDescription, getDescriptor, getDisplayName, getDynamic, getItem, getItemCreatePermission, getJob, getOwner, getPeople, getPostConstructLandingPage, getQueueItems, getSearchUrl, getTimeline, getUrl, getViewName, getViewUrl, getWidgets, hasPeople, hasPermission, isDefault, isEditable, isFilterExecutors, isFilterQueue, makeSearchIndex, rename
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListView

@DataBoundConstructor
public ListView(String name)

ListView

public ListView(String name,
                ViewGroup owner)
Method Detail

save

public void save()
          throws IOException
Description copied from interface: Saveable
Persists the state of this object into XML.

For making a bulk change efficiently, see BulkChange.

To support listeners monitoring changes to this object, call SaveableListener.fireOnChange(Saveable, hudson.XmlFile)

Specified by:
save in interface Saveable
Throws:
IOException - if the persistence failed.

hasJobFilterExtensions

public boolean hasJobFilterExtensions()
Used to determine if we want to display the Add button.


getJobFilters

public DescribableList<ViewJobFilter,Descriptor<ViewJobFilter>> getJobFilters()

getColumns

public Iterable<ListViewColumn> getColumns()

getItems

public List<TopLevelItem> getItems()
Returns a read-only view of all Jobs in this view.

This method returns a separate copy each time to avoid concurrent modification issue.

Specified by:
getItems in class View

contains

public boolean contains(TopLevelItem item)
Description copied from class: View
Checks if the job is in this collection.

Specified by:
contains in class View

add

public void add(TopLevelItem item)
         throws IOException
Adds the given item to this view.

Throws:
IOException
Since:
1.389

getIncludeRegex

public String getIncludeRegex()

getStatusFilter

public Boolean getStatusFilter()
Filter by enabled/disabled status of jobs. Null for no filter, true for enabled-only, false for disabled-only.


doCreateItem

public Item doCreateItem(org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp)
                  throws IOException,
                         javax.servlet.ServletException
Description copied from class: View
Creates a new Item in this collection.

This method should call Hudson.doCreateItem(StaplerRequest, StaplerResponse) and then add the newly created item to this view.

Specified by:
doCreateItem in class View
Returns:
null if fails.
Throws:
IOException
javax.servlet.ServletException

onJobRenamed

public void onJobRenamed(Item item,
                         String oldName,
                         String newName)
Description copied from class: View
Called when a job name is changed or deleted.

If this view contains this job, it should update the view membership so that the renamed job will remain in the view, and the deleted job is removed.

Specified by:
onJobRenamed in class View
Parameters:
item - The item whose name is being changed.
oldName - Old name of the item. Always non-null.
newName - New name of the item, if the item is renamed. Or null, if the item is removed.

getDefaultColumns

public static List<ListViewColumn> getDefaultColumns()
Deprecated. as of 1.391 Use ListViewColumn.createDefaultInitialColumnList()



Copyright © 2004-2013 Hudson. All Rights Reserved.