Package hudson.model
Class ViewGroupMixIn
- java.lang.Object
-
- hudson.model.ViewGroupMixIn
-
public abstract class ViewGroupMixIn extends Object
ImplementsViewGroupto be used as a "mix-in". Not meant for a consumption from outsideViewGroups.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 protectedViewGroupMixIn(ViewGroup owner)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddView(View v)booleancanDelete(View view)voiddeleteView(View view)ViewgetPrimaryView()Returns the primaryViewthat renders the top-page of Hudson ornullif there is no primary one defined.ViewgetView(String name)Gets a view by the specified name.Collection<View>getViews()Gets the read-only list of allViews.voidonViewRenamed(View view, String oldName, String newName)protected abstract StringprimaryView()Gets primary view of the mix-in.protected abstract voidprimaryView(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,
nullif 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.nullto 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 throughViewGroups if required.- Parameters:
name- Name of the view- Returns:
- View instance or
nullif it is missing
-
getViews
@Exported public Collection<View> getViews()
Gets the read-only list of allViews.
-
getPrimaryView
@Exported @CheckForNull public View getPrimaryView()
Returns the primaryViewthat renders the top-page of Hudson ornullif there is no primary one defined.
-
-