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.AsynchPeople, View.People, View.PropertyList, View.UserInfo
 
Nested 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, transientActions
 
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.
 org.kohsuke.stapler.HttpResponse doAddJobToView(String name)
           
 Item doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Creates a new Item in this collection.
 org.kohsuke.stapler.HttpResponse doRemoveJobFromView(String name)
           
 DescribableList<ListViewColumn,Descriptor<ListViewColumn>> getColumns()
          If this view uses <t:projectView> for rendering, this method returns columns to be displayed.
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.
protected  void initColumns()
           
protected  void initJobFilters()
           
 boolean isRecurse()
           
 boolean jobNamesContains(TopLevelItem item)
           
 void onJobRenamed(Item item, String oldName, String newName)
          Called when a job name is changed or deleted.
protected  void submit(org.kohsuke.stapler.StaplerRequest req)
          Handles the configuration submission.
 
Methods inherited from class hudson.model.View
all, allInstantiable, checkPermission, create, createViewFromXML, doConfigDotXml, doConfigSubmit, doDoDelete, doRssAll, doRssFailed, doRssLatest, doSubmitDescription, getAbsoluteUrl, getACL, getActions, getAllProperties, getApi, getApplicablePropertyDescriptors, getApproximateQueueItemsQuickly, getAsynchPeople, getBuilds, getComputers, getDescription, getDescriptor, getDisplayName, getDynamic, getIndenter, getItem, getItemCreatePermission, getJob, getNewPronoun, getOwner, getOwnerItemGroup, getOwnerPrimaryView, getOwnerViewActions, getPeople, getPostConstructLandingPage, getProperties, getQueueItems, getSearchUrl, getTimeline, getUrl, getViewName, getViewUrl, getWidgets, hasPeople, hasPermission, isDefault, isEditable, isFilterExecutors, isFilterQueue, makeSearchIndex, rename, save, toString, updateByXml, updateTransientActions
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hudson.model.Saveable
save
 

Constructor Detail

ListView

@DataBoundConstructor
public ListView(String name)

ListView

public ListView(String name,
                ViewGroup owner)
Method Detail

initColumns

protected void initColumns()

initJobFilters

protected void initJobFilters()

hasJobFilterExtensions

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


getJobFilters

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

getColumns

public DescribableList<ListViewColumn,Descriptor<ListViewColumn>> getColumns()
Description copied from class: View
If this view uses <t:projectView> for rendering, this method returns columns to be displayed.

Overrides:
getColumns in class View

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

jobNamesContains

public boolean jobNamesContains(TopLevelItem item)

add

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

Throws:
IOException
Since:
1.389

getIncludeRegex

public String getIncludeRegex()

isRecurse

public boolean isRecurse()

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 ModifiableItemGroup.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

doAddJobToView

public org.kohsuke.stapler.HttpResponse doAddJobToView(@QueryParameter
                                                       String name)
                                                throws IOException,
                                                       javax.servlet.ServletException
Throws:
IOException
javax.servlet.ServletException

doRemoveJobFromView

public org.kohsuke.stapler.HttpResponse doRemoveJobFromView(@QueryParameter
                                                            String name)
                                                     throws IOException,
                                                            javax.servlet.ServletException
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.

submit

protected void submit(org.kohsuke.stapler.StaplerRequest req)
               throws javax.servlet.ServletException,
                      Descriptor.FormException,
                      IOException
Handles the configuration submission. Load view-specific properties here.

Specified by:
submit in class View
Throws:
javax.servlet.ServletException
Descriptor.FormException
IOException

getDefaultColumns

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



Copyright © 2004-2013. All Rights Reserved.