Package snap.view

Interface ViewHost

All Known Implementing Classes:
BoxView, ChildView, CollapseView, ColView, GameView, GridView, MarkDownView, PageView, RowView, ScaleBox, Scroller, ScrollView, SplitView, SpringView, StackView, SwitchView, TabView, 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 ViewHost
    getHost(View aView)
    Returns whether given view parent is a ViewHost and view is one of its guests.
    static int
    ViewHost helper method.
    static int
    indexOfGuest(ViewHost aHost, View aView)
    ViewHost helper method.
    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
    setGuests(View[] theViews)
    Sets the array of guests.
    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.
    • setGuests

      default void setGuests(View[] theViews)
      Sets the array of guests.
    • getHost

      static ViewHost getHost(View aView)
      Returns whether given view parent is a ViewHost and view is one of its guests.
    • 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.