Package org.eclipse.ui.views.framelist
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 Summary
Fields Modifier and Type Field Description static String
P_CURRENT_FRAME
Property name constant for the current frame.
-
Constructor Summary
Constructors Constructor Description FrameList(IFrameSource source)
Creates a new frame list with the given source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(IPropertyChangeListener listener)
Adds a property change listener.void
back()
Moves the frame pointer back by one.protected void
firePropertyChange(PropertyChangeEvent event)
Notifies any property change listeners that a property has changed.void
forward()
Moves the frame pointer forward by one.Frame
getCurrentFrame()
Returns the current frame.int
getCurrentIndex()
Returns the index of the current frame.Frame
getFrame(int index)
Returns the frame at the given index, ornull
if the index is ≤ 0 or ≥size()
.IFrameSource
getSource()
Returns the frame source.void
gotoFrame(Frame frame)
Adds the given frame after the current frame, and advances the pointer to the new frame.void
removePropertyChangeListener(IPropertyChangeListener listener)
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
updateCurrentFrame()
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 Detail
-
P_CURRENT_FRAME
public static final String P_CURRENT_FRAME
Property name constant for the current frame.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FrameList
public FrameList(IFrameSource source)
Creates a new frame list with the given source.- Parameters:
source
- the frame source
-
-
Method Detail
-
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 aP_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:
IPropertyChangeListener.propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
-
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
public Frame 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
public Frame getFrame(int index)
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
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 aP_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 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.
-
-