| org.netbeans.swing.tabcontrol.TabDataModel
All known Subclasses: org.netbeans.swing.tabcontrol.DefaultTabDataModel,
TabDataModel | public interface TabDataModel (Code) | | 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.
author: Tim Boudreau |
Method Summary | |
public void | addChangeListener(ChangeListener listener) The model will fire a change event whenever a modification occurs that
could require a repaint. | public void | addComplexListDataListener(ComplexListDataListener listener) | public void | addTab(int index, TabData data) | public void | addTabs(int start, TabData[] data) | public void | addTabs(int[] indices, TabData[] data) | public TabData | getTab(int index) | public java.util.List<TabData> | getTabs() | public int | indexOf(TabData td) Fetch the index of a tab matching the passed TabData object. | public void | removeChangeListener(ChangeListener listener) The model will fire a change event whenever a modification occurs that
could require a repaint. | public void | removeComplexListDataListener(ComplexListDataListener listener) | public void | removeTab(int index) | public void | removeTabs(int[] indices) | public void | removeTabs(int start, int end) | public void | setIcon(int index, Icon i) Set the icon for a given tab. | public void | setIcon(int[] indices, Icon[] icons) Atomically set the icons for a set of indices. | public void | setIconsAndText(int[] indices, String[] txt, Icon[] icons) Atomically set the icons and text simultaneously for more than one tab.
Fires a single list data event with the indexes of any tabs in which the
data was actually changed. | public void | setTab(int index, TabData data) | public void | setTabs(TabData[] data) | public void | setText(int index, String txt) Set the text for a given tab. | public void | setText(int[] indices, String[] txt) Atomically set the text for a number of tabs. | public int | size() The number of tabs contained in the model. |
addChangeListener | public void addChangeListener(ChangeListener listener)(Code) | | The model will fire a change event whenever a modification occurs that
could require a repaint. This method is only here for the
prototype - eventually the UI delegate should listen for ComplexDataNN
events and optimize repaints based on the actual areas affected.
|
addComplexListDataListener | public void addComplexListDataListener(ComplexListDataListener listener)(Code) | | Add a data listener
Parameters: listener - The listener |
addTab | public void addTab(int index, TabData data)(Code) | | Add a single tab at the specified location
|
addTabs | public void addTabs(int start, TabData[] data)(Code) | | Atomically add a set of tabs at the specified index
Parameters: start - The insert point for new tabs Parameters: data - The tab data to insert |
addTabs | public void addTabs(int[] indices, TabData[] data)(Code) | | Add the specified tabs at the specified indices
Parameters: indices - The indices at which tabs will be added Parameters: data - The tabs to add, in order corresponding to the indicesparameter |
getTab | public TabData getTab(int index)(Code) | | Retrieve data for a given tab
Parameters: index - The index for which to retrieve tab data Data describing the tab |
getTabs | public java.util.List<TabData> getTabs()(Code) | | Retrieve all the tab data contained in the model as a List
a List of TabData objects |
removeChangeListener | public void removeChangeListener(ChangeListener listener)(Code) | | The model will fire a change event whenever a modification occurs that
could require a repaint. This method is only here for the
prototype - eventually the UI delegate should listen for ComplexDataNN
events and optimize repaints based on the actual areas affected.
|
removeComplexListDataListener | public void removeComplexListDataListener(ComplexListDataListener listener)(Code) | | Remove a data listener
Parameters: listener - The listener |
removeTab | public void removeTab(int index)(Code) | | Remove the tab at the specified index
Parameters: index - The tab index |
removeTabs | public void removeTabs(int[] indices)(Code) | | Remove the tabs at the specified indices
Parameters: indices - The indices at which tabs should be removed |
removeTabs | public void removeTabs(int start, int end)(Code) | | Remove a range of tabs
Parameters: start - the start index Parameters: end - the end index |
setIcon | public void setIcon(int index, Icon i)(Code) | | Set the icon for a given tab. Will trigger a list data event, and the
resulting event's widthChanged property will be set appropriately if the
displayed width has changed.
Parameters: index - The index to set the icon for Parameters: i - The icon to use for the tab |
setIcon | public void setIcon(int[] indices, Icon[] icons)(Code) | | Atomically set the icons for a set of indices. Fires a single list data
event with the indexes of any tabs in which the data was actually
changed. If the passed data perfectly match the existing data, no event
will be fired.
Parameters: indices - The indices for which the corresponding icons should bechanged Parameters: icons - The replacement icons. This array must be the same lengthas the indices parameter |
setIconsAndText | public void setIconsAndText(int[] indices, String[] txt, Icon[] icons)(Code) | | Atomically set the icons and text simultaneously for more than one tab.
Fires a single list data event with the indexes of any tabs in which the
data was actually changed. If the passed data perfectly match the
existing data, no event will be fired.1
Parameters: indices - The indices which should have their data changed Parameters: txt - The replacement text values corresponding to the passedindices Parameters: icons - The replacement icons corresponding to the passed indices |
setTab | public void setTab(int index, TabData data)(Code) | | Set the tab data for a given tab to the passed value
Parameters: index - The index of the tab to be changed Parameters: data - The new tab data for this index |
setTabs | public void setTabs(TabData[] data)(Code) | | Replace the entire set of tabs represented by the model
|
setText | public void setText(int index, String txt)(Code) | | Set the text for a given tab. Triggers a list data event.
Parameters: index - The index of the tab Parameters: txt - The replacement text |
setText | public void setText(int[] indices, String[] txt)(Code) | | Atomically set the text for a number of tabs. Fires a single list data
event with the indexes of any tabs in which the data was actually
changed. If the passed data perfectly match the existing data, no event
will be fired.1
Parameters: indices - The indices of the tabs to change Parameters: txt - The text values for the tabs |
size | public int size()(Code) | | The number of tabs contained in the model.
The number of tabs |
|
|