hudson.model
Interface ViewGroup

All Superinterfaces:
AccessControlled, ModelObject, Saveable
All Known Implementing Classes:
AbstractCIBase, Hudson, Jenkins, MockFolder, MyViewsProperty, TreeView

public interface ViewGroup
extends Saveable, ModelObject, AccessControlled

Container of Views.

Since:
1.269
Author:
Kohsuke Kawaguchi

Field Summary
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Method Summary
 boolean canDelete(View view)
          Determine whether a view may be deleted.
 void deleteView(View view)
          Deletes a view in this group.
 ItemGroup<? extends TopLevelItem> getItemGroup()
          Returns the ItemGroup from which the views in this group should render items.
 View getPrimaryView()
          If the view group renders one view in its own URL (like Jenkins top page does), then that view is called the primary view.
 String getUrl()
          Returns the path of this group, relative to the context root, like "foo/bar/zot/".
 View getView(String name)
          Gets a view of the given name.
 List<Action> getViewActions()
          Returns actions that should be displayed in views.
 Collection<View> getViews()
          Gets all the views in this group.
 ViewsTabBar getViewsTabBar()
          Gets the TabBar for the views.
 void onViewRenamed(View view, String oldName, String newName)
          View calls this method when it's renamed.
 
Methods inherited from interface hudson.model.Saveable
save
 
Methods inherited from interface hudson.model.ModelObject
getDisplayName
 
Methods inherited from interface hudson.security.AccessControlled
checkPermission, getACL, hasPermission
 

Method Detail

canDelete

boolean canDelete(View view)
Determine whether a view may be deleted.

Since:
1.365

deleteView

void deleteView(View view)
                throws IOException
Deletes a view in this group.

Throws:
IOException

getViews

Collection<View> getViews()
Gets all the views in this group.

Returns:
can be empty but never null.

getView

View getView(String name)
Gets a view of the given name. This also creates the URL binding for views (in the form of ".../view/FOOBAR/...")


getPrimaryView

View getPrimaryView()
If the view group renders one view in its own URL (like Jenkins top page does), then that view is called the primary view. In this case, the hyperlink to the primary view points to the view group itself.

If the view group doesn't do such rendering, this method can always return null.

This method was added later to ViewGroup, so old plugins might not be implementing this. To work around this, Views can use View.getOwnerPrimaryView().

Since:
1.417

getUrl

String getUrl()
Returns the path of this group, relative to the context root, like "foo/bar/zot/". Note no leading slash but trailing slash.


onViewRenamed

void onViewRenamed(View view,
                   String oldName,
                   String newName)
View calls this method when it's renamed. This method is intended to work as a notification to the ViewGroup (so that it can adjust its internal data structure, for example.)

It is the caller's responsibility to ensure that the new name is a legal view name.


getViewsTabBar

ViewsTabBar getViewsTabBar()
Gets the TabBar for the views. TabBar for views can be provided by extension. Only one TabBar can be active at a given time (Selectable by user in the global Configuration page). Default TabBar is provided by Hudson Platform.

Since:
1.381

getItemGroup

ItemGroup<? extends TopLevelItem> getItemGroup()
Returns the ItemGroup from which the views in this group should render items.

Generally speaking, Views render a subset of TopLevelItems that belong to this item group. This method was added later to ViewGroup, so old plugins might not be implementing this. To work around this, Views can use View.getOwnerItemGroup().

Returns:
Never null. Sometimes this is ModifiableItemGroup (if the container allows arbitrary addition)
Since:
1.417

getViewActions

List<Action> getViewActions()
Returns actions that should be displayed in views.

In this interface, the return value is used read-only. This doesn't prevent subtypes from returning modifiable actions, however.

This method was added later to ViewGroup, so old plugins might not be implementing this. To work around this, Views can use View.getOwnerViewActions().

Returns:
may be empty but never null.
Since:
1.417
See Also:
Actionable.getActions()


Copyright © 2004-2013. All Rights Reserved.