Class AbstractFolderViewHolder
- java.lang.Object
-
- com.cloudbees.hudson.plugins.folder.views.AbstractFolderViewHolder
-
- Direct Known Subclasses:
DefaultFolderViewHolder
public abstract class AbstractFolderViewHolder extends Object
Responsible for holding the view configuration of anAbstractFolder
. EachAbstractFolder
concrete type should define its view configuration holder by returning the implementation fromAbstractFolder.newFolderViewHolder()
Use-cases:-
Where the
AbstractFolder
permits the views to be configured by the user, use aDefaultFolderViewHolder
-
Where the
AbstractFolder
has a fixed set of pre-configured views, the plugin can provide a custom implementation that returns the fixed set of views.
- Since:
- FIXME
-
-
Constructor Summary
Constructors Constructor Description AbstractFolderViewHolder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
getPrimaryView()
Returns theView.getViewName()
of the primary view ornull
if the first view should be primary.abstract ViewsTabBar
getTabBar()
Returns theViewsTabBar
.abstract List<View>
getViews()
Returns the list of views.void
invalidateCaches()
Called byAbstractFolder.save()
to signal that the view holder should clear any internal state caches.boolean
isPrimaryModifiable()
Returnstrue
if the primaryView
is modifiable.boolean
isTabBarModifiable()
Returnstrue
if theViewsTabBar
is modifiable.boolean
isViewsModifiable()
Returnstrue
if the list of views is modifiable.abstract void
setPrimaryView(String name)
Changes the primaryView
.abstract void
setTabBar(ViewsTabBar tabBar)
Changes theViewsTabBar
.abstract void
setViews(List<? extends View> views)
Changes the list ofView
s.
-
-
-
Method Detail
-
getViews
@NonNull public abstract List<View> getViews()
Returns the list of views. IfisViewsModifiable()
then this list is modifiable.- Returns:
- the list of views.
-
setViews
public abstract void setViews(@NonNull List<? extends View> views)
- Parameters:
views
- the new list ofView
s.- See Also:
isViewsModifiable()
-
isViewsModifiable
public boolean isViewsModifiable()
Returnstrue
if the list of views is modifiable.- Returns:
true
if the list of views is modifiable.
-
getPrimaryView
@CheckForNull public abstract String getPrimaryView()
Returns theView.getViewName()
of the primary view ornull
if the first view should be primary.- Returns:
- the
View.getViewName()
of the primary view ornull
if the first view should be primary.
-
setPrimaryView
public abstract void setPrimaryView(@CheckForNull String name)
- Parameters:
name
- theView.getViewName()
of the primaryView
ofnull
to use the first view.- See Also:
isPrimaryModifiable()
-
isPrimaryModifiable
public boolean isPrimaryModifiable()
Returnstrue
if the primaryView
is modifiable.- Returns:
true
if the primaryView
is modifiable.
-
getTabBar
@NonNull public abstract ViewsTabBar getTabBar()
Returns theViewsTabBar
.- Returns:
- the
ViewsTabBar
.
-
setTabBar
public abstract void setTabBar(@NonNull ViewsTabBar tabBar)
- Parameters:
tabBar
- the newViewsTabBar
.- See Also:
isTabBarModifiable()
-
isTabBarModifiable
public boolean isTabBarModifiable()
Returnstrue
if theViewsTabBar
is modifiable.- Returns:
true
if theViewsTabBar
is modifiable.
-
invalidateCaches
public void invalidateCaches()
Called byAbstractFolder.save()
to signal that the view holder should clear any internal state caches.
-
-