org.crosswire.common.swing.desktop

## Interface Viewable

- All Superinterfaces:
    Iterable<Component>
  All Known Implementing Classes:
    AbstractViewLayout, MDIViewLayout, TDIViewLayout, ViewManager

      public interface Viewable
      extends Iterable<Component>

  Interface defining what is Viewable.
  Author:
    DM Smith
  See Also:
    `The GNU General Public License for details.`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addView(Component component)` Add a view to the set.
    `void` | `addViewEventListener(ViewEventListener listener)` Adds a view event listener for notification of any changes to the view.
    `void` | `closeAll()` Close all the views.
    `void` | `closeOthers(Component component)` Close all the views but the one provided.
    `Component` | `getSelected()` Returns the top view.
    `Component` | `getView(int i)` Get the view by position.
    `int` | `getViewCount()` The number of views held by this layout.
    `Collection<Component>` | `getViews()` Get a snapshot of the views as a collection.
    `void` | `moveTo(AbstractViewLayout other)` Copies all the views from the one layout to the other
    `void` | `removeView(Component component)` Remove a view from the set.
    `void` | `removeViewEventListener(ViewEventListener listener)` Removes a view event listener.
    `void` | `select(Component component)` Find the view and select it.
    `void` | `updateTitle(Component component)` Update the title of the view.
    `void` | `visit(ViewVisitor visitor)` Visit every view in the order that they were added.

    - ### Methods inherited from interface java.lang.Iterable

      `iterator`

- - ### Method Detail

    - #### addView

          void addView(Component component)

      Add a view to the set.

    - #### removeView

          void removeView(Component component)

      Remove a view from the set.

    - #### getViews

          Collection<Component> getViews()

      Get a snapshot of the views as a collection.
      Returns:
        the views

    - #### moveTo

          void moveTo(AbstractViewLayout other)

      Copies all the views from the one layout to the other
      Parameters:
        `other` - the other layout

    - #### closeAll

          void closeAll()

      Close all the views. Note the policy is enforced that one view is kept. This will keep the last one added.

    - #### closeOthers

          void closeOthers(Component component)

      Close all the views but the one provided.
      Parameters:
        `component` - the view that is to remain open.

    - #### visit

          void visit(ViewVisitor visitor)

      Visit every view in the order that they were added.
      Parameters:
        `visitor` - The visitor for the view

    - #### updateTitle

          void updateTitle(Component component)

      Update the title of the view. If the component does not implement Titleable, then a generated title will be used.
      Parameters:
        `component` - the component whose title is to be used

    - #### getSelected

          Component getSelected()

      Returns the top view. If no view is the top, it returns the first one added.

    - #### select

          void select(Component component)

      Find the view and select it.
      Parameters:
        `component` -

    - #### getViewCount

          int getViewCount()

      The number of views held by this layout.
      Returns:
        the number of views held by this layout

    - #### getView

          Component getView(int i)

      Get the view by position. Note that adding and removing views changes the indexes of the views. Do not use this for iteration as it is not thread safe.
      Parameters:
        `i` - the index of the view
      Returns:
        the requested view.

    - #### addViewEventListener

          void addViewEventListener(ViewEventListener listener)

      Adds a view event listener for notification of any changes to the view.
      Parameters:
        `listener` - the listener

    - #### removeViewEventListener

          void removeViewEventListener(ViewEventListener listener)

      Removes a view event listener.
      Parameters:
        `listener` - the listener