Package snap.view

Interface ViewHost

All Known Implementing Classes:
BoxView, ChildView, CollapseView, ColView, FontPicker.FontSampleView, GridView, PageView, RowView, ScaleBox, Scroller, ScrollView, SplitView, SpringView, StackView, SwitchView, TitleView

public interface ViewHost
An interface for Views primarily intended to hold other (arbitrary) views.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addGuest(View aChild)
    Adds the given view to the end of this view's guest list.
    void
    addGuest(View aChild, int anIndex)
    ViewHost method: Adds the given view to this host's guest (children) list at given index.
    static void
    fromXMLGuests(ViewHost aHost, XMLArchiver anArchiver, XMLElement anElement)
    XML unarchival of ViewHost.Guests.
    getGuest(int anIndex)
    ViewHost method: Returns the guest view at given index.
    int
    ViewHost method: Returns the number of guest views.
    default View[]
    Returns the array of guests.
    static View[]
    Returns the guests array.
    static ViewHost
    getHost(View aView)
    Returns whether given view parent is a ViewHost and view is one of its guests.
    static int
    ViewHost helper method.
    default int
    ViewHost helper method.
    static int
    indexOfGuest(ViewHost aHost, View aView)
    ViewHost helper method.
    static boolean
    isGuest(View aView)
    Returns whether given view parent is a ViewHost and view is one of its guests.
    static boolean
    isGuest(ViewHost aHost, View aView)
    Returns whether given view is a guest view of this ViewHost.
    removeGuest(int anIndex)
    ViewHost method: Remove's guest at given index from this host's guest (children) list.
    default int
    Removes the given child from this view's children list.
    default void
    Removes all children from this view (in reverse order).
    static void
    Removes all children from this view (in reverse order).
    static void
    setGuests(ViewHost aHost, View... theChildren)
    Sets children to given list.
    static void
    toXMLGuests(ViewHost aHost, XMLArchiver anArchiver, XMLElement anElement)
    XML archival of ViewHost.Guests.
  • Method Details

    • getGuestCount

      int getGuestCount()
      ViewHost method: Returns the number of guest views.
    • getGuest

      View getGuest(int anIndex)
      ViewHost method: Returns the guest view at given index.
    • addGuest

      void addGuest(View aChild, int anIndex)
      ViewHost method: Adds the given view to this host's guest (children) list at given index.
    • removeGuest

      View removeGuest(int anIndex)
      ViewHost method: Remove's guest at given index from this host's guest (children) list.
    • addGuest

      default void addGuest(View aChild)
      Adds the given view to the end of this view's guest list.
    • removeGuest

      default int removeGuest(View aView)
      Removes the given child from this view's children list.
    • getGuests

      default View[] getGuests()
      Returns the array of guests.
    • indexOfGuest

      default int indexOfGuest(View aView)
      ViewHost helper method.
    • removeGuests

      default void removeGuests()
      Removes all children from this view (in reverse order).
    • getGuests

      static View[] getGuests(ViewHost aHost)
      Returns the guests array.
    • setGuests

      static void setGuests(ViewHost aHost, View... theChildren)
      Sets children to given list.
    • removeGuests

      static void removeGuests(ViewHost aHost)
      Removes all children from this view (in reverse order).
    • getHost

      static ViewHost getHost(View aView)
      Returns whether given view parent is a ViewHost and view is one of its guests.
    • isGuest

      static boolean isGuest(View aView)
      Returns whether given view parent is a ViewHost and view is one of its guests.
    • isGuest

      static boolean isGuest(ViewHost aHost, View aView)
      Returns whether given view is a guest view of this ViewHost.
    • indexOfGuest

      static int indexOfGuest(ViewHost aHost, View aView)
      ViewHost helper method.
    • indexInHost

      static int indexInHost(View aView)
      ViewHost helper method.
    • toXMLGuests

      static void toXMLGuests(ViewHost aHost, XMLArchiver anArchiver, XMLElement anElement)
      XML archival of ViewHost.Guests.
    • fromXMLGuests

      static void fromXMLGuests(ViewHost aHost, XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival of ViewHost.Guests.