Class FrameList

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.views.framelist.FrameList

public class FrameList extends EventManager
Supports a web-browser style of navigation by maintaining a list of frames. Each frame holds a snapshot of a view at some point in time.

The frame list obtains a snapshot of the current frame from a frame source on creation, and whenever switching to a different frame.

A property change notification is sent whenever the current page changes.

  • Field Details

    • P_CURRENT_FRAME

      public static final String P_CURRENT_FRAME
      Property name constant for the current frame.
      See Also:
  • Constructor Details

    • FrameList

      public FrameList(IFrameSource source)
      Creates a new frame list with the given source.
      Parameters:
      source - the frame source
  • Method Details

    • addPropertyChangeListener

      public void addPropertyChangeListener(IPropertyChangeListener listener)
      Adds a property change listener. Has no effect if an identical listener is already registered.
      Parameters:
      listener - a property change listener
    • back

      public void back()
      Moves the frame pointer back by one. Has no effect if there is no frame before the current one. Fires a P_CURRENT_FRAME property change event.
    • firePropertyChange

      protected void firePropertyChange(PropertyChangeEvent event)
      Notifies any property change listeners that a property has changed. Only listeners registered at the time this method is called are notified.
      Parameters:
      event - the property change event
      See Also:
    • forward

      public void forward()
      Moves the frame pointer forward by one. Has no effect if there is no frame after the current one. Fires a P_CURRENT_FRAME property change event.
    • getCurrentFrame

      public Frame getCurrentFrame()
      Returns the current frame. Returns null if there is no current frame.
      Returns:
      the current frame, or null
    • getCurrentIndex

      public int getCurrentIndex()
      Returns the index of the current frame.
      Returns:
      the index of the current frame
    • getFrame

      public Frame getFrame(int index)
      Returns the frame at the given index, or null if the index is ≤ 0 or ≥ size().
      Parameters:
      index - the index of the requested frame
      Returns:
      the frame at the given index or null
    • getSource

      public IFrameSource getSource()
      Returns the frame source.
    • gotoFrame

      public void gotoFrame(Frame frame)
      Adds the given frame after the current frame, and advances the pointer to the new frame. Before doing so, updates the current frame, and removes any frames following the current frame. Fires a P_CURRENT_FRAME property change event.
      Parameters:
      frame - the frame to add
    • removePropertyChangeListener

      public void removePropertyChangeListener(IPropertyChangeListener listener)
      Removes a property change listener. Has no effect if an identical listener is not registered.
      Parameters:
      listener - a property change listener
    • setCurrentIndex

      public void setCurrentIndex(int index)
      Sets the current frame to the frame with the given index. Fires a P_CURRENT_FRAME property change event if the current frame changes.
    • size

      public int size()
      Returns the number of frames in the frame list.
    • updateCurrentFrame

      public void updateCurrentFrame()
      Replaces the current frame in this list with the current frame from the frame source. No event is fired.