Package hudson.model
Class ViewGroupMixIn
- java.lang.Object
-
- hudson.model.ViewGroupMixIn
-
public abstract class ViewGroupMixIn extends Object
ImplementsViewGroup
to be used as a "mix-in". Not meant for a consumption from outsideViewGroup
s.How to use this class
-
Create three data fields in your class:
private String primaryView; private CopyOnWriteArrayList<View> views; private ViewsTabBar viewsTabBar;
-
Define a transient field and store ViewGroupMixIn subtype, then wire up getters and setters:
private transient ViewGroupMixIn = new ViewGroupMixIn() { List<View> views() { return views; } ... }
- Author:
- Kohsuke Kawaguchi
- See Also:
ItemGroupMixIn
-
Create three data fields in your class:
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ViewGroupMixIn(ViewGroup owner)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addView(View v)
boolean
canDelete(View view)
void
deleteView(View view)
View
getPrimaryView()
Returns the primaryView
that renders the top-page of Hudson ornull
if there is no primary one defined.View
getView(String name)
Gets a view by the specified name.Collection<View>
getViews()
Gets the read-only list of allView
s.void
onViewRenamed(View view, String oldName, String newName)
protected abstract String
primaryView()
Gets primary view of the mix-in.protected abstract void
primaryView(String newName)
Sets the primary view.protected abstract List<View>
views()
Returns all views in the group.
-
-
-
Constructor Detail
-
ViewGroupMixIn
protected ViewGroupMixIn(ViewGroup owner)
-
-
Method Detail
-
views
@NonNull protected abstract List<View> views()
Returns all views in the group. This list must be modifiable and concurrently iterable.
-
primaryView
@CheckForNull protected abstract String primaryView()
Gets primary view of the mix-in.- Returns:
- Name of the primary view,
null
if there is no primary one defined.
-
primaryView
protected abstract void primaryView(String newName)
Sets the primary view.- Parameters:
newName
- Name of the primary view to be set.null
to make the primary view undefined.
-
addView
public void addView(@NonNull View v) throws IOException
- Throws:
IOException
-
canDelete
public boolean canDelete(@NonNull View view)
-
deleteView
public void deleteView(@NonNull View view) throws IOException
- Throws:
IOException
-
getView
@CheckForNull public View getView(@CheckForNull String name)
Gets a view by the specified name. The method iterates throughViewGroup
s if required.- Parameters:
name
- Name of the view- Returns:
- View instance or
null
if it is missing
-
getViews
@Exported public Collection<View> getViews()
Gets the read-only list of allView
s.
-
getPrimaryView
@Exported @CheckForNull public View getPrimaryView()
Returns the primaryView
that renders the top-page of Hudson ornull
if there is no primary one defined.
-
-