public class FrameList extends EventManager
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.
Modifier and Type | Field and Description |
---|---|
static String |
P_CURRENT_FRAME
Property name constant for the current frame.
|
Constructor and Description |
---|
FrameList(IFrameSource source)
Creates a new frame list with the given source.
|
Modifier and Type | Method and 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, or
null
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.
|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public static final String P_CURRENT_FRAME
public FrameList(IFrameSource source)
source
- the frame sourcepublic void addPropertyChangeListener(IPropertyChangeListener listener)
listener
- a property change listenerpublic void back()
P_CURRENT_FRAME
property change event.protected void firePropertyChange(PropertyChangeEvent event)
event
- the property change eventIPropertyChangeListener.propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
public void forward()
P_CURRENT_FRAME
property change event.public Frame getCurrentFrame()
null
if there is no current frame.null
public int getCurrentIndex()
public Frame getFrame(int index)
null
if the index is ≤ 0 or ≥ size()
.index
- the index of the requested framenull
public IFrameSource getSource()
public void gotoFrame(Frame frame)
P_CURRENT_FRAME
property change event.frame
- the frame to addpublic void removePropertyChangeListener(IPropertyChangeListener listener)
listener
- a property change listenerpublic void setCurrentIndex(int index)
P_CURRENT_FRAME
property change event
if the current frame changes.public int size()
public void updateCurrentFrame()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.