Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.jdeveloper.dialogs
Class ClassPackageListItem

java.lang.Object
  extended by oracle.javatools.editor.insight.ListDataItem
      extended by oracle.jdeveloper.dialogs.ClassPackageListItem

All Implemented Interfaces:
java.lang.Comparable

public final class ClassPackageListItem
extends ListDataItem

An implementation of ListDataItem for use when displaying a class or a package.


Nested Class Summary
static class ClassPackageListItem.Type
           

 

Field Summary
static oracle.jdeveloper.dialogs.ClassPackageListItem.ClassPackageSorter COMPARATOR
          A Comparator that orders ClassPackageListItem objects by their display name in case-insensitive order.

 

Constructor Summary
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.

 

Method Summary
 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()
           

 

Methods inherited from class oracle.javatools.editor.insight.ListDataItem
compareInsensitive, compareSensitive, getAccessibleText

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

COMPARATOR

public static final oracle.jdeveloper.dialogs.ClassPackageListItem.ClassPackageSorter COMPARATOR
A Comparator that orders ClassPackageListItem objects by their display name in case-insensitive order. Package items are sorted to the end.

Constructor Detail

ClassPackageListItem

public 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.
Parameters:
fullyQualifiedName - a class or package name, should not be null
type - the item type - this should not be null

Method Detail

getIcon

public javax.swing.Icon getIcon()
Description copied from class: ListDataItem
Fetches an icon associated with this type of data item that can pictorially provide some information for this data item. For example, the icon may represent the type of the data item (i.e., package or class), or some other characteristic of the data item (i.e., public or private.)
Specified by:
getIcon in class ListDataItem
Returns:
an icon representing this data item

getDisplayText

public java.lang.String getDisplayText()
Description copied from class: ListDataItem
Fetches a displayable text for this item that can be used as the visible text within a list cell. When using the ListDataItemCellRenderer, this display text is what is rendered visibly.
Specified by:
getDisplayText in class ListDataItem
Returns:
a String with the displayable text

getName

public java.lang.String getName()
Description copied from class: ListDataItem
Fetches the display name of this data item. This is typically what is entered by a completion insight implementation into the buffer.

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.

Specified by:
getName in class ListDataItem
Returns:
the name for this data item

getType

public ClassPackageListItem.Type getType()

compareTo

public int compareTo(java.lang.Object object)
Description copied from class: ListDataItem
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

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.

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class ListDataItem
Parameters:
object - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


Copyright © 1997, 2011, Oracle. All rights reserved.