|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TabModel
TabModel is used to provide information on a collection of
tabs, including their title, icons and the components that represent the
tab's content.
This is designed to support "lazy" loading of the tabs content and TabbedPane will not call getComponentAt(index) until absolutely needed.
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener listener)
Adds listener as a listener to changes in the model. |
Component |
getTabAt(int index,
boolean isSelected)
This is called to retrieve a Component that represents the
title of the tab at the specified index. |
Component |
getTabContentAt(int index)
This is called to retrieve the Component that represents
the contents of the tab at the specified index. |
TabImageRenderer |
getTabImageRenderer()
This is called to return a TabImageRenderer which can be
used to render the tabs as images. |
int |
indexOfTab(Component tabComponent)
This is called to return the index of the component that makes up a tab. |
void |
releaseTabAt(int index)
This is called when the content of a tab is no longer selected and hence resources associated with it may be released by the underlying TabModel. |
void |
removeChangeListener(ChangeListener listener)
Removes listener as a listener to changes in the model. |
int |
size()
This is called to return how many tabs are returned by this TabModel. |
| Method Detail |
|---|
TabImageRenderer getTabImageRenderer()
TabImageRenderer which can be
used to render the tabs as images. This can be null, in which case tabs
cannot be rendered as images.
TabImageRenderer or nullint size()
TabModel.
Component getTabAt(int index,
boolean isSelected)
Component that represents the
title of the tab at the specified index.
The returned Component must be unique since it will become a child of the TabbedPane so it can be fully rendered.
If the returned Component has ActionListeners, such as a ButtonEx, then the parent TabbedPane wil attach itself so it can know when the Tab is pressed and hence has become selected. If not then it is the responbility of the component to inform that TabbedPane of the events that may affect tab selection.
This method may be called at any time and does not support lazy loading of the tabs (since it makes no sense as they must all be visible in order to select one).
index - -
the index of the tabisSelected - -
true if the index is the current selected tab index.
index or null
if there isnt a component at that indexComponent getTabContentAt(int index)
Component that represents
the contents of the tab at the specified index. This is
designed to be lazy loaded, and hence will not be called until absolutely
needed.
However once it has been called it may be called multiples times again so
take care about how content Component s are dynamically
created.
index - -
the index of the tab
index or null if there isnt a component at the
indexvoid releaseTabAt(int index)
TabModel. The content Component will have been released
from the TabbedPane when this call is made.
index - -
the index of the tab to be releasedint indexOfTab(Component tabComponent)
tabComponent - -
the component to return and index for
void addChangeListener(ChangeListener listener)
void removeChangeListener(ChangeListener listener)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||