站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

DefaultTabDataModel (Tab Control) - NetBeans API Javadoc (Current Development Version)

org.netbeans.swing.tabcontrol 1.8

org.netbeans.swing.tabcontrol
Class DefaultTabDataModel

java.lang.Object
  extended by org.netbeans.swing.tabcontrol.DefaultTabDataModel
All Implemented Interfaces:
TabDataModel
Direct Known Subclasses:
SlideBarDataModel.Impl

public class DefaultTabDataModel
extends Object
implements TabDataModel

Default implementation of TabDataModel.


Constructor Summary
DefaultTabDataModel()
          Creates a new instance of DefaultTabDataModel
DefaultTabDataModel(TabData[] data)
          Testing constructor
 
Method Summary
 void addChangeListener(ChangeListener listener)
          Registers ChangeListener to receive events.
 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)
          Removes ChangeListener from the list of listeners.
 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 from start up to and including finish.
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultTabDataModel

public DefaultTabDataModel()
Creates a new instance of DefaultTabDataModel


DefaultTabDataModel

public DefaultTabDataModel(TabData[] data)
Testing constructor

Method Detail

getTabs

public List<TabData> getTabs()
Description copied from interface: TabDataModel
Retrieve all the tab data contained in the model as a List

Specified by:
getTabs in interface TabDataModel
Returns:
a List of TabData objects

getTab

public TabData getTab(int index)
Description copied from interface: TabDataModel
Retrieve data for a given tab

Specified by:
getTab in interface TabDataModel
Parameters:
index - The index for which to retrieve tab data
Returns:
Data describing the tab

setTabs

public void setTabs(TabData[] data)
Description copied from interface: TabDataModel
Replace the entire set of tabs represented by the model

Specified by:
setTabs in interface TabDataModel

setIcon

public void setIcon(int index,
                    Icon i)
Description copied from interface: TabDataModel
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.

Specified by:
setIcon in interface TabDataModel
Parameters:
index - The index to set the icon for
i - The icon to use for the tab

setText

public void setText(int index,
                    String txt)
Description copied from interface: TabDataModel
Set the text for a given tab. Triggers a list data event.

Specified by:
setText in interface TabDataModel
Parameters:
index - The index of the tab
txt - The replacement text

setIconsAndText

public void setIconsAndText(int[] indices,
                            String[] txt,
                            Icon[] icons)
Description copied from interface: TabDataModel
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

Specified by:
setIconsAndText in interface TabDataModel
Parameters:
indices - The indices which should have their data changed
txt - The replacement text values corresponding to the passed indices
icons - The replacement icons corresponding to the passed indices

setIcon

public void setIcon(int[] indices,
                    Icon[] icons)
Description copied from interface: TabDataModel
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.

Specified by:
setIcon in interface TabDataModel
Parameters:
indices - The indices for which the corresponding icons should be changed
icons - The replacement icons. This array must be the same length as the indices parameter

setText

public void setText(int[] indices,
                    String[] txt)
Description copied from interface: TabDataModel
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

Specified by:
setText in interface TabDataModel
Parameters:
indices - The indices of the tabs to change
txt - The text values for the tabs

setTab

public void setTab(int index,
                   TabData data)
Description copied from interface: TabDataModel
Set the tab data for a given tab to the passed value

Specified by:
setTab in interface TabDataModel
Parameters:
index - The index of the tab to be changed
data - The new tab data for this index

addTab

public void addTab(int index,
                   TabData data)
Description copied from interface: TabDataModel
Add a single tab at the specified location

Specified by:
addTab in interface TabDataModel

addTabs

public void addTabs(int start,
                    TabData[] data)
Description copied from interface: TabDataModel
Atomically add a set of tabs at the specified index

Specified by:
addTabs in interface TabDataModel
Parameters:
start - The insert point for new tabs
data - The tab data to insert

removeTab

public void removeTab(int index)
Description copied from interface: TabDataModel
Remove the tab at the specified index

Specified by:
removeTab in interface TabDataModel
Parameters:
index - The tab index

removeTabs

public void removeTabs(int start,
                       int end)
Remove a range of tabs from start up to and including finish.

Specified by:
removeTabs in interface TabDataModel
Parameters:
start - the start index
end - the end index

addTabs

public void addTabs(int[] indices,
                    TabData[] data)
Description copied from interface: TabDataModel
Add the specified tabs at the specified indices

Specified by:
addTabs in interface TabDataModel
Parameters:
indices - The indices at which tabs will be added
data - The tabs to add, in order corresponding to the indices parameter

removeTabs

public void removeTabs(int[] indices)
Description copied from interface: TabDataModel
Remove the tabs at the specified indices

Specified by:
removeTabs in interface TabDataModel
Parameters:
indices - The indices at which tabs should be removed

size

public int size()
Description copied from interface: TabDataModel
The number of tabs contained in the model.

Specified by:
size in interface TabDataModel
Returns:
The number of tabs

addComplexListDataListener

public void addComplexListDataListener(ComplexListDataListener listener)
Description copied from interface: TabDataModel
Add a data listener

Specified by:
addComplexListDataListener in interface TabDataModel
Parameters:
listener - The listener

removeComplexListDataListener

public void removeComplexListDataListener(ComplexListDataListener listener)
Description copied from interface: TabDataModel
Remove a data listener

Specified by:
removeComplexListDataListener in interface TabDataModel
Parameters:
listener - The listener

toString

public String toString()
Overrides:
toString in class Object

addChangeListener

public void addChangeListener(ChangeListener listener)
Registers ChangeListener to receive events.

Specified by:
addChangeListener in interface TabDataModel
Parameters:
listener - The listener to register.

removeChangeListener

public void removeChangeListener(ChangeListener listener)
Removes ChangeListener from the list of listeners.

Specified by:
removeChangeListener in interface TabDataModel
Parameters:
listener - The listener to remove.

indexOf

public int indexOf(TabData td)
Description copied from interface: TabDataModel
Fetch the index of a tab matching the passed TabData object. Note that the tooltip property of the passed TabData object is not used to test equality. See also org.netbeans.core.windows.ui.TabData.equals()

Specified by:
indexOf in interface TabDataModel

org.netbeans.swing.tabcontrol 1.8

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.