Package hudson.model

Class ViewGroupMixIn

java.lang.Object
hudson.model.ViewGroupMixIn

public abstract class ViewGroupMixIn extends Object
Implements ViewGroup to be used as a "mix-in". Not meant for a consumption from outside ViewGroups.

How to use this class

  1. Create three data fields in your class:
    
     private String primaryView;
     private CopyOnWriteArrayList<View> views;
     private ViewsTabBar viewsTabBar;
     
  2. 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:
  • Constructor Details

    • ViewGroupMixIn

      protected ViewGroupMixIn(ViewGroup owner)
  • Method Details

    • 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 through ViewGroups 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 all Views.
    • getPrimaryView

      @Exported @CheckForNull public View getPrimaryView()
      Returns the primary View that renders the top-page of Hudson or null if there is no primary one defined.
    • onViewRenamed

      public void onViewRenamed(View view, String oldName, String newName)