Package hudson.model

Class 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; }
    Kohsuke Kawaguchi
    See Also:
    • Constructor Detail

      • ViewGroupMixIn

        protected ViewGroupMixIn​(ViewGroup owner)
    • Method Detail

      • views

        protected abstract List<View> views()
        Returns all views in the group. This list must be modifiable and concurrently iterable.
      • primaryView

        protected abstract String primaryView()
        Gets primary view of the mix-in.
        Name of the primary view, null if there is no primary one defined.
      • primaryView

        protected abstract void primaryView​(String newName)
        Sets the primary view.
        newName - Name of the primary view to be set. null to make the primary view undefined.
      • canDelete

        public boolean canDelete​(@NonNull
                                 View view)
      • getView

        public View getView​(@CheckForNull
                            String name)
        Gets a view by the specified name. The method iterates through ViewGroups if required.
        name - Name of the view
        View instance or null if it is missing
      • getViews

        public Collection<View> getViews()
        Gets the read-only list of all Views.
      • getPrimaryView

        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)