public final class ClassPackageListItem extends ListDataItem
Modifier and Type | Class and Description |
---|---|
static class |
ClassPackageListItem.Type |
Modifier and Type | Field and Description |
---|---|
static oracle.jdeveloper.dialogs.ClassPackageListItem.ClassPackageSorter |
COMPARATOR
A Comparator that orders
ClassPackageListItem objects by
their display name in case-insensitive order. |
Constructor and Description |
---|
ClassPackageListItem(java.lang.String fullyQualifiedName,
ClassPackageListItem.Type type)
Creates a ClassPackageListItem with the fully-qualified class or package
name and sets the type to match the object's type.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object object)
Compares this object with the specified object for order.
|
boolean |
equals(java.lang.Object object) |
java.lang.String |
getDisplayText()
Fetches a displayable text for this item that can be used as
the visible text within a list cell.
|
javax.swing.Icon |
getIcon()
Fetches an icon associated with this type of data item that
can pictorially provide some information for this data item.
|
java.lang.String |
getName()
Fetches the display name of this data item.
|
ClassPackageListItem.Type |
getType() |
int |
hashCode() |
java.lang.String |
toString() |
compareInsensitive, compareSensitive, getAccessibleText
public static final oracle.jdeveloper.dialogs.ClassPackageListItem.ClassPackageSorter COMPARATOR
ClassPackageListItem
objects by
their display name in case-insensitive order. Package items are sorted
to the end.public ClassPackageListItem(java.lang.String fullyQualifiedName, ClassPackageListItem.Type type)
fullyQualifiedName
- a class or package name, should not be nulltype
- the item type - this should not be nullpublic javax.swing.Icon getIcon()
ListDataItem
getIcon
in class ListDataItem
public java.lang.String getDisplayText()
ListDataItem
ListDataItemCellRenderer
, this display text is
what is rendered visibly.getDisplayText
in class ListDataItem
public java.lang.String getName()
ListDataItem
For example, let's suppose a data item represents a Java method. Its
internal name might be "String.substring()", while its display name
as returned by this method getName()
might be
"substring", while its displayable text might be
"substring() returns String".
When sorting ListDataItems
using its
Comparable
implementation, it is the display name as
returned by getName()
that is used for sorting purposes,
not the displayable text.
getName
in class ListDataItem
public ClassPackageListItem.Type getType()
public int compareTo(java.lang.Object object)
ListDataItem
Although this method is not declared final, it is recommended that subclasses do not override it unless they define another abstract class which overrides this routine for ALL subsequent data items. It could be pretty confusing (and unpredictable) otherwise if there are different data item classes with different compareTo() implementations.
compareTo
in interface java.lang.Comparable
compareTo
in class ListDataItem
object
- the Object to be compared.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object