|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TabDataModel
A data model representing a set of tabs and their associated data. Allows for
atomic add/remove/modification operations any of which are guaranteed to fire
only one event on completion. Note that for modification operations
(setText()
, setIcon
, setIconsAndText
,
no event will be fired unless data is actually changed - calling these
methods with the same values that the tabs already have will not generate
events. The isWidthChanged
method for generated events will
return true
for events which can affect the area needed to
display a tab (such as text or icon width changes).
Note: The standard UI implementations which use this model make no provisions for thread-safety. All changes fired from a TabDataModel should happen on the AWT event thread.
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener listener)
The model will fire a change event whenever a modification occurs that could require a repaint. |
void |
addComplexListDataListener(ComplexListDataListener listener)
Add a data listener |
void |
addTab(int index,
TabData data)
Add a single tab at the specified location |
void |
addTabs(int[] indices,
TabData[] data)
Add the specified tabs at the specified indices |
void |
addTabs(int start,
TabData[] data)
Atomically add a set of tabs at the specified index |
TabData |
getTab(int index)
Retrieve data for a given tab |
List<TabData> |
getTabs()
Retrieve all the tab data contained in the model as a List |
int |
indexOf(TabData td)
Fetch the index of a tab matching the passed TabData object. |
void |
removeChangeListener(ChangeListener listener)
The model will fire a change event whenever a modification occurs that could require a repaint. |
void |
removeComplexListDataListener(ComplexListDataListener listener)
Remove a data listener |
void |
removeTab(int index)
Remove the tab at the specified index |
void |
removeTabs(int[] indices)
Remove the tabs at the specified indices |
void |
removeTabs(int start,
int end)
Remove a range of tabs |
void |
setIcon(int[] indices,
Icon[] icons)
Atomically set the icons for a set of indices. |
void |
setIcon(int index,
Icon i)
Set the icon for a given tab. |
void |
setIconsAndText(int[] indices,
String[] txt,
Icon[] icons)
Atomically set the icons and text simultaneously for more than one tab. |
void |
setTab(int index,
TabData data)
Set the tab data for a given tab to the passed value |
void |
setTabs(TabData[] data)
Replace the entire set of tabs represented by the model |
void |
setText(int[] indices,
String[] txt)
Atomically set the text for a number of tabs. |
void |
setText(int index,
String txt)
Set the text for a given tab. |
int |
size()
The number of tabs contained in the model. |
Method Detail |
---|
int size()
TabData getTab(int index)
index
- The index for which to retrieve tab data
void setTab(int index, TabData data)
index
- The index of the tab to be changeddata
- The new tab data for this indexvoid setIcon(int index, Icon i)
index
- The index to set the icon fori
- The icon to use for the tabvoid setText(int index, String txt)
index
- The index of the tabtxt
- The replacement textvoid setIcon(int[] indices, Icon[] icons)
indices
- The indices for which the corresponding icons should be
changedicons
- The replacement icons. This array must be the same length
as the indices parametervoid setText(int[] indices, String[] txt)
indices
- The indices of the tabs to changetxt
- The text values for the tabsvoid setIconsAndText(int[] indices, String[] txt, Icon[] icons)
indices
- The indices which should have their data changedtxt
- The replacement text values corresponding to the passed
indicesicons
- The replacement icons corresponding to the passed indicesvoid addTabs(int start, TabData[] data)
start
- The insert point for new tabsdata
- The tab data to insertvoid removeTab(int index)
index
- The tab indexvoid addTabs(int[] indices, TabData[] data)
indices
- The indices at which tabs will be addeddata
- The tabs to add, in order corresponding to the indices
parametervoid setTabs(TabData[] data)
void removeTabs(int[] indices)
indices
- The indices at which tabs should be removedvoid removeTabs(int start, int end)
start
- the start indexend
- the end indexvoid addTab(int index, TabData data)
List<TabData> getTabs()
int indexOf(TabData td)
void addComplexListDataListener(ComplexListDataListener listener)
listener
- The listenervoid removeComplexListDataListener(ComplexListDataListener listener)
listener
- The listenervoid addChangeListener(ChangeListener listener)
void removeChangeListener(ChangeListener listener)
|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |