Package org.eclipse.ui.views.framelist
Class FrameList
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.views.framelist.FrameList
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 Summary
Modifier and TypeFieldDescriptionstatic final String
Property name constant for the current frame. -
Constructor Summary
ConstructorDescriptionFrameList
(IFrameSource source) Creates a new frame list with the given source. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a property change listener.void
back()
Moves the frame pointer back by one.protected void
Notifies any property change listeners that a property has changed.void
forward()
Moves the frame pointer forward by one.Returns the current frame.int
Returns the index of the current frame.getFrame
(int index) Returns the frame at the given index, ornull
if the index is ≤ 0 or ≥size()
.Returns the frame source.void
Adds the given frame after the current frame, and advances the pointer to the new frame.void
Removes a property change listener.void
setCurrentIndex
(int index) Sets the current frame to the frame with the given index.int
size()
Returns the number of frames in the frame list.void
Replaces the current frame in this list with the current frame from the frame source.Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Field Details
-
P_CURRENT_FRAME
Property name constant for the current frame.- See Also:
-
-
Constructor Details
-
FrameList
Creates a new frame list with the given source.- Parameters:
source
- the frame source
-
-
Method Details
-
addPropertyChangeListener
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 aP_CURRENT_FRAME
property change event. -
firePropertyChange
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 aP_CURRENT_FRAME
property change event. -
getCurrentFrame
Returns the current frame. Returnsnull
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
Returns the frame at the given index, ornull
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
Returns the frame source. -
gotoFrame
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 aP_CURRENT_FRAME
property change event.- Parameters:
frame
- the frame to add
-
removePropertyChangeListener
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 aP_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.
-