public final class TabData extends Object implements Comparable
TabData objects implement their equals()
and
hashCode
contract based on the equality of the user object and
the text. The icon and the tooltip text are not considered when testing
equality.
TabDataModel
,
DefaultTabDataModel
Constructor and Description |
---|
TabData(Object userObject,
Icon i,
String caption,
String tooltip)
Create a new TabData object.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o)
Compares the text based on java.lang.String's implementation of
Comparable.
|
boolean |
equals(Object o)
Returns true if the text and component properties of this TabData object
match the passed one.
|
Component |
getComponent()
The component for the tab.
|
Icon |
getIcon()
The icon for the tab.
|
String |
getText()
The text for the tab
|
String |
getTooltip()
The tooltip for the tab
|
Object |
getUserObject() |
int |
hashCode()
Munges the text and component hash codes
|
String |
toString()
Get a string representation of this object
|
public TabData(Object userObject, Icon i, String caption, String tooltip)
userObject
- The object or component that should be displayed when
the tab is selected. For use in TabbedContainer, this
should be an instance of java.awt.Component
i
- The icon for the tabcaption
- The caption for the tabtooltip
- The tooltip for the tabpublic Object getUserObject()
public Component getComponent()
public Icon getIcon()
public String getText()
public String getTooltip()
public String toString()
public boolean equals(Object o)
public int hashCode()
public int compareTo(Object o)
compareTo
in interface Comparable